我想将静态查询的 url 重写为:
example.com/register => example.com/login.php?page=register
我正在使用这个:
RewriteRule ^register login.php?page=register [NC,L]
像这样使用它:
RewriteEngine On
RewriteRule ^(register)/?$ /login.php?page=$1 [NC,L,QSA]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(register)$ login.php?page=$1 [NC,QSA,L]
或者:
RewriteRule ^register$ login.php?page=register [NC,QSA,L]