gpt4 book ai didi

html - 当url中有空格时htaccess重定向

转载 作者:技术小花猫 更新时间:2023-10-29 12:29:37 25 4
gpt4 key购买 nike

我想从一个仍然出现在谷歌搜索中的旧网址重定向到新网址。旧网址是这样的:

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

我想将它重定向到主页:

http://www.marionettecolla.org/

我在我的 .htaccess 中使用了这个:

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

但我收到错误 500...有人知道如何解决这个问题吗?

最佳答案

这应该有效:

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

只需将它放在一对双引号之间 "... "

更新:

这也是另一种方式,适用于任何类型的空间:

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

关于html - 当url中有空格时htaccess重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12670703/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com