Html – htaccess redirect when there is a space in url

.htaccesshtmlredirecturlweb

I want to redirect from a old url which still appears in the google search to the new one. the old url is this:

http://www.marionettecolla.org/file%20_mostra_milano/mostra_marionette-milano.htm

and I want to redirect it to the home page:

http://www.marionettecolla.org/

I used this in my .htaccess:

Redirect http://marionettecolla.org/file\ _mostra_milano/mostra_marionette-milano.htm http://marionettecolla.org/

but I am getting Error 500… Does anybody know how to solve this problem?

Best Answer

this should works:

Redirect 301 "http://marionettecolla.org/file _mostra_milano/mostra_marionette-milano.htm" http://marionettecolla.org/

just put it between pair of double-quotes " ... "

Update:

This is another way also, should works for any kind of spaces:

redirectMatch 301 http://marionettecolla.org/file[\s]_mostra_milano/mostra_marionette-milano.htm http://marionettecolla.org/