Bad Request - Invalid URL when loading page

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

When trying to access a page with some special characters in its URL (i.e: <baseURL>/display/SPACEKEY/Test+%09Test), you'll receive the following instead:

This can occur with any value between %00-%1F, inclusive.

Cause

This will only happen if you're using the IIS proxy. When Confluence makes a page it takes the content of the title and encodes it if need be. The characters %00 to %1F represent ASCII control characters, which were originally designed to control hardware devices. You may still see these characters occasionally in text, such as %09, which represents the 'tab' character.

Workaround

To allow control characters to be used in URLs, please follow the instructions from this Microsoft KB article to set the "AllowRestrictedChars" registry key to true. This requires a restart of both the HTTP and IIS related services to take effect. A full server restart will do both.

An easy way to do this is to copy the following into a .reg file and run it on your server (for more information see https://support.microsoft.com/en-us/kb/310516/):

Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters]
"AllowRestrictedChars"=dword:00000001

 

Alternatively, you can remove the control character from the title itself. To do so:

  1. Find the id of the page with this SQL query:

    select contentid from content
    where title like '%<PAGE_TITLE>%'
  2. Go directly to the editor for this page with this URL:

    <baseURL>/pages/editpage.action?pageId=<PAGEID_FROM_QUERY>

     

  3. Rename the page, removing the control character.

Last modified on Feb 26, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.