网址中有空格时,htaccess重定向 [英] htaccess redirect when there is a space in url

查看:87
本文介绍了网址中有空格时,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.

这篇关于网址中有空格时,htaccess重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆