好吧,所以我需要为我想要的操作找到正确的语法。用不同的格式重写规则301
这些链接:
http://www.example.com/sub1/sub2/product1/
(...)
http://www.example.com/sub1/sub2/product700/
需要重定向到
http://www.example.com/sub3/product1-newsite/
(...)
http://www.example.com/sub3/product700-newsite/
我曾尝试:
RewriteEngine On
RewriteRule ^/sub1/(.*)/(.*)$ http://www.example.com/subdir/$1-newsite/ [R=301,L]
对于所有的700种产品。 另外我需要对某些产品进行豁免。
有人可以看到我在做什么错吗?
你重定向到什么地方(说)http://www.example.com/sub1/sub2/product1/? –
我现在有700条规则: 重定向301/sub1/sub2/product1 http://www.example.com/sub3/product1-newsite 我的.htaccess现在差不多80千字节,正在寻找一种方法来缩小文件大小。 –