网址中有空格时,htaccess重定向

编程入门 行业动态 更新时间:2024-10-23 02:06:44
本文介绍了网址中有空格时,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:

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

,我想将其重定向到主页:

and I want to redirect it to the home page:

www.marionettecolla/

我在.htaccess中使用了它:

I used this in my .htaccess:

Redirect marionettecolla/file\ _mostra_milano/mostra_marionette-milano.htm marionettecolla/

但我收到错误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重定向

本文发布于:2023-10-31 13:00:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546157.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中有   空格   重定向   网址   htaccess

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!