0

我从未使用过 htaccess 重定向,我使用的是 prestashop 1.3 并且有重复的 url

http://www.domain.com/catyegory/product.html
http://www.domain.com/lang-es/catyegory/product.html

http://www.domain.com/catyegory-1/product.html
http://www.domain.com/lang-es/catyegory-1/product.html

其他语言不会出现此问题,我需要将不包含任何lang-xx的 url 重定向到与lang-es相同的 url

我正在尝试,但不起作用

Redirect 301 !([ lang-es)(*.) http://www.domain.com/lang-es/$1

谢谢

4

1 回答 1

0

您的表达式中有语法错误(没有关闭[),您也应该使用RewriteCond来获取“不以”表达式:

RewriteCond %{REQUEST_URI} !^lang-es/.*
RewriteRule (.*) http://www.domain.com/lang-es/$1
于 2013-11-10T10:04:58.723 回答