Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正如标题所述,我将如何更改我的重写规则,以便在我的规则中允许特殊字符,例如 _、- 或 _
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/$ index.php?p=$1&s=$2 [L,QSA]
我的总体目标是允许链接,例如
http://mywebsite.com/users/test_
没有给出 404 因为它不允许下划线。
解决方案
RewriteRule ^([a-zA-Z0-9:_-]+)/([a-zA-Z0-9:_-]+)/$ index.php?p=$1&s=$2 [L,QSA]