AppServ mod-rewrite无法识别$ _GET变量

时间:2017-02-13 23:51:24

标签: php .htaccess mod-rewrite

最近我在新PC上安装了AppServ。

与往常一样,我开始在PHP中开发一个先前配置了.htaccess文件的脚本

情况就是这样:


的.htaccess

RewriteEngine On

RewriteRule ^step/token/([a-zA-Z0-9_-]+)/?$   step.php?load=page&page=reset-token&token=$1   [L,QSA]


step.php

print_r($_GET)


测试#1

如果我加载网址

http://localhost/mod-rewrite/step.php?load=page&page=reset-token&token=123

这是输出:

Array ( [load] => page [page] => reset-token [token] => 123 )


测试#2

如果我加载了所需格式的网址

http://localhost/mod-rewite/step/token/123/

问题

Array ( )


C:\ AppServ \ Apache2.2 \ conf \ httpd.conf

LoadModule rewrite_module modules / mod_rewrite.so不以#

开头

AllowOverride是全部

<directory />
    Options FollowSymLinks
    AllowOverride All
    order deny,allow
    Deny from all
</directory>


可能会发生什么?

1 个答案:

答案 0 :(得分:0)

解决方案是将.htaccess“Options -MultiViews”

置于开头

然后重启服务

感谢@Phil

相关问题