Forum Moderators: phranque

Message Too Old, No Replies

RedirectPermanent with a space in the filename

How To

         

jonrichd

4:55 pm on Mar 11, 2003 (gmt 0)

10+ Year Member



I've switched some files around on a site where the original creator used spaces in filenames.

On the address bar, the filename would be:

[mysite.com...]

When I try to use .htaccess to redirect this, e.g.

RedirectPermanent /file%20name.htm [mysite.com...]

I get a 404 error back without a redirect. If I change it to

RedirectPermanent /filename.htm [mysite.com...]

(without the space) the redirect works fine, but of course, that's not the name I want to redirect. Just putting a real space in the filename doesn't work either.

Anybody have any idea what to do about the spaces?

andreasfriedrich

5:45 pm on Mar 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




RedirectPermanent [httpd.apache.org] "aaron c.html" [ac.com...]

works for me. Add quotes around the absolute URL-path argument.

HTH Andreas

jonrichd

6:00 pm on Mar 11, 2003 (gmt 0)

10+ Year Member



Thanks Andreas, that did the trick. Now it's in the archives for anyone else that runs into the same problem.