当我在htaccess中重定向301时循环

时间:2018-08-09 16:48:13

标签: wordpress .htaccess redirect

我这样配置.htaccess:

Redirect 301 /ranking https://mysite.com.br/ranking/sobre

但是在网址返回中

https://mysite.com.br/ranking/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/sobre/

1 个答案:

答案 0 :(得分:1)

您应该使用RedirectMatch来支持正则表达式:

RedirectMatch 301 ^/(ranking)/?$ https://mysite.com.br/$1/sobre

在测试此更改之前,请确保清除浏览器缓存。

还要确保这是您的首要规则。