Wednesday, September 20, 2006

Apache Redirects For URLs with spaces

I had an external web site link to one of my pages, but a space was accidentally appended to the link, eg.,
"<a href="">Pennies</a>".

My error.log file was filling up with 404 errors. The easy solution was to do an apache redirect, but it was a little tricky because of the space. I tried putting in the "%20" at the end, but apache liked simple double quotes to define the trailing space. The line in the .htaccess looked like this:

Redirect "/Misc/Pennies/ "

1 comment:

Jon Stout said...

Awesome. Had the same problem. Thanks for the help.