Apache2使用GET参数将所有请求发送到index.php

时间:2015-09-01 10:11:20

标签: apache

我有这个代码用于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>

1 个答案:

答案 0 :(得分:1)

/etc/httpd/conf/extra/httpd-vhosts.conf中的

我已经改变了

RewriteEngine On
RewriteCond $1 !^(static)
RewriteRule ^/(.*)$ /index.php?page=$1 [PT]

代表

RewriteEngine On
RewriteCond $1 !^(static)
RewriteRule ^/(.*)$ /index.php?page=$1 [L,QSA]
相关问题