关于Apache rewrite规则忽略下划线后缀的语法
当访问http://localhost/abc/test 定位到http://localhost/abc/test.shtml所以当前的规则如下:RewriteRule ^/abc/(.*)$ /website/abc/$1.shtml
但是如果在结尾加上一个下划线http://localhost/abc/test/ 就会404错误, 我的目的是访问http://localhost/abc/test这个URL无论是否以下划线结尾都会跳转到 /website/abc/$1.shtml这个页.特来请求帮助. RewriteRule ^/abc/([^/]*)/?$ /website/abc/$1.shtml 回复 2# bikong0411
非常感谢, 一条正则解决问题.
页:
[1]