.htaccess URL重定向无法使用空间

时间:2016-07-13 05:30:22

标签: .htaccess redirect

http://example.com/Richiesta%20Preventivo/index.html

.htaccess代码

Redirect 301 /Richiesta%20Preventivo/index.html http://example.com/

Redirect 301 /Richiesta Preventivo/index.html http://example.com/

以上两个代码都不起作用。正如我们所看到的, Richiesta Preventivo 之间存在创造问题的空间。第一个代码不起作用,第二个代码导致500内部服务器错误。我想知道如何使用空格重定向URL。

1 个答案:

答案 0 :(得分:1)

除非你引用uri字符串,否则%20指令中不允许

Redirect,请尝试

Redirect 301 "/Richiesta%20Preventivo/index.html" http://example.com/

Redirect 301 "/Richiesta Preventivo/index.html" http://example.com/