.htaccess and ?_escaped_fragment_=



我的.htaccess文件现在看起来像(没有别的):

DirectoryIndex index.php
RewriteEngine on
RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule ^$ test.php$1 [QSA,L]
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php

当我尝试请求此网址时:http://example.com/test?_escaped_fragment_=blog=123&ggg=3

我看到的是来自测试控制器的html,而不是我的测试.php文件。请帮忙,我做错了什么?

将第一条规则更改为:

RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
RewriteRule !^test.php$ test.php [L]

最新更新