这是我从URLhtaccess
隐藏的内容?m
。
RewriteEngine On
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]*)$ index.php?m=$1 [QSA,L]
</IfModule>
的一个示例$1
可能是my_profile
。现在,我希望用户将其视为my-profile
,但PHP
值$_GET['m']
仍然应该是my_profile
。我怎样才能做到这一点 ?
好的,所以如果我正确收到您的请求,您正在打电话:mydomain.com/my-profile
那么以下方法将起作用:
RewriteEngine On
RewriteRule ^([^-]*)-([^-]*-.*) $1_$2 [N]
RewriteRule ^([^-]*)-([^-]*)$ index.php?m=$1_$2 [L]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句