Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 重写规则不能与“一起使用”&引用;_Php_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Php 重写规则不能与“一起使用”&引用;

Php 重写规则不能与“一起使用”&引用;,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,我使用wamp在本地测试URLEWRITE,并搜索以执行此操作: index.php?test=test123到带有查询字符串的index/test123 我的.htaccess: Options +FollowSymlinks RewriteEngine on # Rule RewriteRule ^index/([a-z0-9]+)$ index.php?test=$1 [QSA,L] 这是工作,但$\u GET[“test”]为空。。如果我测试这个: RewriteRule ^inde

我使用wamp在本地测试URLEWRITE,并搜索以执行此操作:
index.php?test=test123到带有查询字符串的index/test123
我的.htaccess:

Options +FollowSymlinks
RewriteEngine on

# Rule
RewriteRule ^index/([a-z0-9]+)$ index.php?test=$1 [QSA,L]
这是工作,但$\u GET[“test”]为空。。如果我测试这个:

RewriteRule ^index-([a-z0-9]+)$ index.php?test=$1 [QSA,L]
这是工作$_获取[“test”]=“test123”。

当分别测试“-”工作和“/”不工作时。您的
/
规则按预期工作。禁用内容协商:
选项+FollowSymlinks-MultviViews
我在我的服务器上测试过,也可以工作,但为什么不能在本地工作?@julp谢谢,使用
-MultiViews
可以重复