Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 have a problem that a marketing e-mail was sent out to clients with a link to our website, but it ended in a space. In other words, it goes to something like Sending another e-mail with a correct link would probably be seen by the clients as spam, so we're trying to fix it on our end.

I tried adding a redirect rule to .htaccess, but it is failing before it gets to that point.

The Apache error log shows the following error:

(20024)The given path is misformatted or contained invalid characters: Cannot map GET /cost-per-invoice-calculator/%20 HTTP/1.1 to file

Any suggestions? This is Apache on a Windows server, if that is relevant...

share|improve this question

migrated from Feb 18 '10 at 16:10

This question came from our site for professional and enthusiast programmers.

It looks like this is something that has been given status WONTFIX by the Apache team:

share|improve this answer

.htaccess is parsed pretty late in the game, I bet Cez was doing it in his httpd.conf, allowing it to proc before the bad character check that triggers on the space.

Also, if your Apache is fronted by some kind of load balancer or proxy or whatnot, doing the rewrite there would definitely work.

share|improve this answer

OK, this is on a Linux server, but I don't appear to have a problem redirecting a URL that contains a space:

RewriteEngine on
RewriteRule ^.*test\ $ / [R=301,L]

This performs the following redirection:

http://localhost/test%20 -> http://localhost/ 

EDIT: Yes, as per Ernest Mueller's comment, this is in the server config, not in .htaccess

share|improve this answer

Your Answer


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