0

我需要重写所有 http://onlifestyle.org/(DIRECTORY)/cagory/post 形式的链接,以 http://onlifestyle.org/cagory/post 的形式显示浏览器中,但仍然点击http://onlifestyle.org/(DIRECTORY)/cagory/post上的资源 谢谢

4

1 回答 1

1

内部重定向http://onlifestyle.org/catogory/posthttp://onlifestyle.org/directory/catogory/post

RewriteRule ^category/post/?$ /directory/category/post [L]

将您的 URL 从更改http://onlifestyle.org/directory/catogory/posthttp://onlifestyle.org/catogory/post

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+directory/category/post/? [NC]
RewriteRule ^ /category/post [R=302,L]

如果一切正常,如果您愿意,请将 302 更改为 301。

于 2013-07-28T04:22:37.787 回答