我需要在我的RewriteRule文件上创建一个.htaccess文件,如果它包含在URL末尾的,它将删除路径(“页面-2”)。例如:
http://myhost.com/path/page-2应重定向到:
http://myhost.com/path我找到了一个类似的解决方案:
RewriteEngine On
RewriteRule ^([^/.]+)/?$ /$1/page-2/ [L]不过,这对我不起作用。不发生重定向。有什么帮助吗?
发布于 2014-09-16 10:09:32
你需要有这样的规则:
RewriteEngine On
RewriteRule ^(.+?)/page-2/?$ /$1 [L,NC,R=301]https://stackoverflow.com/questions/25865884
复制相似问题