我想将一个url重写为静态查询:
example.com/register => example.com/login.php?page=register
我正在使用它:
RewriteRule ^register login.php?page=register [NC,L]
答案 0 :(得分:2)
像这样使用:
RewriteEngine On
RewriteRule ^(register)/?$ /login.php?page=$1 [NC,L,QSA]
答案 1 :(得分: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]