在Windows服务器上,我们运行Helicon Ape以运行.htaccess
规则并安装了PHP。我有以下的.htaccess
文件行根目录:.htaccess Windows服务器上的RewriteRule问题
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^test/(.*)$ test/handle.php?path=$1 [L]
</IfModule>
我handle.php
文件写了下面的代码。
echo $_GET["path"];
exit;
当我输入任何像这样的网址:http://mysite.com/test/test.zip
或http://mysite/test/FILENAME.EXT
不是打印FILENAME.EXT
它只是打印handle.php
作为输出!怎么了?
最有可能的PHP未正确设置你的网络服务器。创建一个test.php并把'<?php phpinfo(); ?>看看你得到了什么。 – anubhava