首页 文章

.htaccess取消重复性任务

提问于
浏览
0

我有点问题,这里是我的日志:

1. strip per-dir prefix: C:/wamp/www/web.site/projects/test/ -> projects/test/
2. applying pattern '(.*)' to uri 'projects/test/'
3. RewriteCond: input='C:/wamp/www/web.site/projects/test/' pattern='!-f' => matched
4. RewriteCond: input='C:/wamp/www/web.site/projects/test//index.php' pattern='!-f' => not-matched
5. pass through C:/wamp/www/web.site/projects/test/
6. strip per-dir prefix: C:/wamp/www/web.site/projects/test/index.php -> projects/test/index.php
7. applying pattern '(.*)' to uri 'projects/test/index.php'
8. RewriteCond: input='C:/wamp/www/web.site/projects/test/index.php' pattern='!-f' => not-matched
9. pass through C:/wamp/www/web.site/projects/test/index.php

.

问题是,为什么它不会停在5号线?或者为什么第9行不是第5行?有办法防止这种情况吗?这里是我的.htaccess文件中的代码 .

.

RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME}/index.php !-f
    RewriteRule (.*) index.php [NC,L]

.

有人可以帮助我吗?我想加快时间 . 先感谢您 .

1 回答

  • 0

    您似乎已经将Apache配置为一个简单的事情:如果有一个请求的目录,那么尝试提供此目录中的“index.php”:

    DirectoryIndex index.php
    

    所以这就是正在发生的事情:Apache重写一切正常,然后看到它是一个目录=>它试图服务器index.php . 这种行为似乎既正常也很常见;)

相关问题