我的网站上有这样的网址:
www.website.com/user/page/someName1
www.website.com/user/page/someName2
www.website.com/user/page/someName3
如何删除或隐藏/用户/页面.htaccess以此结束:
www.website.com/someName1
www.website.com/someName2
www.website.com/someName3
答案 0 :(得分:0)
您可以使用:
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/+user/page/(\S+) [NC]
RewriteRule ^ /%1 [R=301,L]
RewriteRule ^user/page/(.+)$ /$1 [L,NC]