Forum Moderators: phranque

Message Too Old, No Replies

Redirect with blank space

         

Gokke

10:42 am on May 4, 2004 (gmt 0)



Hi! I’m new in this forum and I hope someone can help me with this question.

I have been reading a lot in this forum about redirects but I haven’t found anything covering redirects with empty spaces in the old URL (%20):

The rest of my redirects have been working fine but the one isn’t working.

redirect /old%20file.htm [newdomain...]

Can someone tell me what I should use in the .htaccess instead of the %20 (blank space).

Thanks

jdMorgan

3:33 pm on May 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Gokke,

Welcome to WebmasterWorld [webmasterworld.com]!

Good question!

You could try RedirectMatch, which allows the use of regular expressions, and then try using an escaped space:


RedirectMatch 301 ^/old\ file\.htm$ http://www.newdomain/new_file.com/

Both the space and the period in the original URL-path are preceded by a backslash to tell the regex parser to treat them as literal characters.

For more information on RedirectMatch, see the Apache mod_alias documentation [httpd.apache.org].

Jim