0

我想删除所有网址中的“/item/”,例如:

www.domain.com/it-news/item/4489
www.domain.com/software/item/4484
www.domain.com/it-news/snews/item/4480

应该重定向到:

www.domain.com/it-news/4489
www.domain.com/software/4484
www.domain.com/it-news/snews/4480

你能帮我解决吗 提前谢谢你

4

2 回答 2

0

我没有与 .htaccess 合作太多,但似乎它会像这样

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)/item/(.*)$ $1/$2 [R=301,L]

根据这个网站

于 2013-02-18T12:07:33.073 回答
-1

尝试以下操作:

RewriteEngine On
RewriteRule ^(.*)/item/(.*)$ $1/$2 [R=301,L]
于 2013-02-18T12:20:24.883 回答