htaccess 中有这个正则表达式:
RewriteRule ^collection/([^/_]+)games/$ some.php?coll=$1 [L]
它适用于像“/collection/somegames/”这样的
url,但我希望规则接受这些 url:“/collection/some-games/”被重定向到“some.php?coll=some”,我将其更改为:
RewriteRule ^collection/([^/_]+)-games/$ some.php?coll=$1 [L]
或者
RewriteRule ^collection/([^/_\-]+)-games/$ some.php?coll=$1 [L]
以上都没有帮助。
解决办法是什么?