网址中有空格时,htaccess重定向
问题描述:
我想从仍然显示在Google搜索中的旧网址重定向到新网址。旧网址是这样的:
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/
我在.htaccess中使用了它:
I used this in my .htaccess:
Redirect http://marionettecolla.org/file\ _mostra_milano/mostra_marionette-milano.htm http://marionettecolla.org/
但我收到错误500 ...有人知道如何解决这个问题吗?
but I am getting Error 500... Does anybody know how to solve this problem?
答
您不能只逃避像这样的空间 \ 。正确的方法是 \s 。
You can't just escape space like that "\ ". The proper way to do it is "\s".
尽管我不确定是否用 \s代替htaccess文件中的空格可以解决问题。请让我知道它是否有效。
Although I am not sure if putting "\s" in place of space in htaccess file would do the trick. Please let me know if it worked.