dqcuq4138 2014-02-25 20:54
浏览 56
已采纳

.htaccess和?_escaped_fragment_ =

My .htaccess file now looks like (and nothing else):

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

When i am trying to request this url: http://example.com/test?_escaped_fragment_=blog=123&ggg=3

I am see html from test controller, not my test.php file. Please help, what i am doing wrong?

  • 写回答

1条回答 默认 最新

  • duanjiao6711 2014-02-25 20:56
    关注

    Change your first rule to:

    RewriteCond %{QUERY_STRING} ^_escaped_fragment_=(.*)$
    RewriteRule !^test\.php$ test.php [L]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?