我有这个代码用于apache。它将所有请求发送到index.php,但我丢失了所有GET参数。如何重写它,所以我不会丢失参数。
<VirtualHost *:80>
DocumentRoot /srv/http/framework
ServerName framework.localhost
RewriteEngine On
RewriteCond $1 !^(static)
RewriteRule ^/(.*)$ /index.php?page=$1 [PT]
</VirtualHost>
答案 0 :(得分:1)
我已经改变了
RewriteEngine On
RewriteCond $1 !^(static)
RewriteRule ^/(.*)$ /index.php?page=$1 [PT]
代表
RewriteEngine On
RewriteCond $1 !^(static)
RewriteRule ^/(.*)$ /index.php?page=$1 [L,QSA]