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

I'm currently in the process of applying a variety of 301 redirects in an .htaccess file for a website that recently changed its structure. Everything is working as expected, except for URLs that contain special characters, for these I am getting 404 errors.

For example the following directives that have a registered trademark symbol (®) bring up 404 pages:

RedirectMatch 301 ^/directory/link-with®-special-character(/)?$
RedirectMatch 301 ^/directory/link-with%c2%ae-special-character(/)?$

I've also tried using Redirect, RewriteRule and surrounding the urls with double quotes and nothing seems to work.

Does anyone know what might be happening or the proper way to handle these types of directives?

Any help is greatly appreciated.

share|improve this question
up vote 1 down vote accepted

I can confirm that those two attempts at RedirectMatch fail on my apache installation as well, even accounting for capitalization (my logs see the requests as link-with%C2%AE-special-character).

You might consider using the regex capabilities of RedirectMatch, replacing the trademark symbol placement with either .* or (as seems to work for my apache environment) .., e.g.

RedirectMatch 301 ^/directory/link-with..-special-character(/)?$

As indicated by the urlencoding %C2%AE, this trademark symbol is interpreted as two characters, so .. works as a regex for it, while . does not.

share|improve this answer
I was so wrapped up in trying to figure out why it didn't work, I didn't even think to just use regex... thank you! – dSquared Nov 5 '12 at 13:16

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.