Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We're trying to clean up some 404's on our site and some website is linking to /page.html%C2%A0. I'm trying to match the url with mod rewrite and redirect it to /page.html

RewriteRule ^page.html%C2%A0 /page.html [R=301,L]

This doesn't seem to match the url, I've also tried escaping the percent signs to \%, but that doesn't match either.

Anyone know how to get it working?

share|improve this question
up vote 0 down vote accepted

From looking at your example, I think the problem is likely that you didn't include the leading / that's part of the request. The apache mod_rewrite docs do say that a \ should work. Try:

RewriteRule ^/page.html%C2%A0 /page.html [R=301,L]


RewriteRule ^/page.html\%C2\%A0 /page.html [R=301,L]

If none of those work for some reason, you could always try hitting it with a bigger hammer (a more inclusive ruleset that avoids using the special characters explicitely):

RewriteRule ^/?page.html.+ /page.html [R=301,L]

That will redirect page.html (with or without a leading /) followed by one or more of any character to just straight /page.html.

share|improve this answer
I ended up hitting it with the biggest hammer to get it working and use the ^page.html.+ regex. Thanks. – Noodles Nov 15 '10 at 2:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.