4

我想将静态查询的 url 重写为:

example.com/register => example.com/login.php?page=register

我正在使用这个:

RewriteRule ^register login.php?page=register [NC,L]

4

2 回答 2

2

像这样使用它:

RewriteEngine On

RewriteRule ^(register)/?$ /login.php?page=$1 [NC,L,QSA]
于 2013-10-29T16:39:09.073 回答
0
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]
于 2014-01-10T10:48:24.697 回答