Space/page/blog with space characters in its name gives 404 Page Not Found

I successfully installed Confluence on my server. I already have IIS7 installed on this machine so I set that all requests for Confluence go through IIS web site.

The problem occurs when I create new space, blog post or page and its name includes space character (for example: "New page"). When I click on the title to see this page I get 404 Page Not Found IIS error. I found out that it is because of URL formatting. Confluence shows the URL as: http://mysite.com/confluence/MYSPACE/New+Page. It replaces space character with plus (+) character. If I manually replace it back with space character so the URL is like this: http://mysite.com/confluence/MYSPACE/New page, then it works normally.

If I use names without space characters in them everything works as it should. If I access the web site directly through Tomcat (localhost with port number), everythings works (including the names with space characters). So I assume there is some URL rewrite rule or something similar that works on Tomcat but not when I access site through IIS and my domain name. Are there any guidelines which could help me identify it and fix it?

2 answers

This widget could not be displayed.

And finally I found the answer to my question. It is described here: http://www.softweb.net.au/blogs/development/setting-up-a-friendly-url-for-confluence-using-iis7-url-rewriting

The solution is:

"When you create a document in confluence that has spaces in the name, it will substitute +'s for the spaces in the URL. By default IIS won't process this properly as it is viewed as a security risk. Instead you will see a 404 error if you view the site remotely, or a more informative 404.11 if you try locally. Nonetheless we need to disable this behaviour for our Confluence redirect to get it working properly. You can open up the Request Filtering section, click on the 'Edit Feature Settings' link, then tick 'Allow double escaping'.

It worked for me.

Joe Clark Atlassian Team Jan 29, 2012

We have documentation on setting up IIS 7 with Confluence here: http://confluence.atlassian.com/display/DOC/Connecting+Confluence+with+IIS+7#ConnectingConfluencewithIIS7-DoubleEscapedCharacter

It mentions the need to allow double escaping on your IIS site. :-)

The "double escaping"-solution handles the plus signs of URL to Confluence pages very well. However, I have a problem with attachments that have a plus sign in the filename. If I click on an attachment, I get 404. The URL is http://somedomain.com/download/attachments/7078168/test%2Bpicture.png

Do attachments with plus signs in the name work for you?

Thanks for this. I was having this problem this morning after upgrading to the latest version. I knew I had run into it before but just couldn't remember how to get the URL's to properly resolve. Then I came across this post.

This widget could not be displayed.

Er, you shouldn't use spaces in urls (you should encode spaces with %20% instead), so there isn't really anything to fix.

Maybe I didn't describe the problem good enough. I don't use spaces in URL but for example in Page name as you can see here: http://i40.tinypic.com/2w6t7hl.jpg (the name is "My page name"). When I create such page, I can't see it, because Confluence replaces spaces with pluses: http://i39.tinypic.com/23iz5md.jpg . If I try to see it locally through Tomcat I can see the page normally: http://i44.tinypic.com/2v9yh6s.jpg . So I assume that IIS doesn't know how to handle such url properly.

Ahh, I see, sorry, I thought you were trying to use them.

Yes, it looks like IIS is doing something bad with the + symbols in your URLs, so it's IIS breaking, not Confluence. I found an answer at http://telligent.com/support/analytics/w/documentation/a-plus-sign-in-the-url-causes-a-404.aspx

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

406 views 4 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you