.htaccess Redirect on a url with spaces in it

Viewed 15733

I have a link from anther website that I do not have control of http://example.com/one two three.exe

The correct URL is http://example.com/one_two_three.exe

Note the underscores instead of spaces.

I searched the internet and found this code snippet for .htaccess

# Redirect old file path to new file path
Redirect /one%20two%20three.exe http://example.com/one_two_three.exe

I added this snippet to my preexisting root .htaccess at the top of the file.
But it does not seem to work. My browser does not redirect and I get a 404 error page.

I believe that it has something to do with the spaces in the original URL but I don't know how to handle spaces in the URL.

Suggestions?

1 Answers
Related