为什么apache mod_rewrite没有正确路由/索引?

时间:2016-03-09 10:36:33

标签: php apache .htaccess mod-rewrite

工作正常:

  • 转到/index.php网站主页加载

  • 转到/sdagkljahsdf/sdfsafdsaf/网站(框架)404时 通过index.php

  • 加载

工作不正确:

  • 转到/index apache错误消息附带Not FoundThe requested URL /index was not found on this server.

因此,使用apache 404不通过框架index.php

进行路由

我希望它通过index.php

进行路由

这是我的.htaccess

SetEnv APPLICATION_ENV []
php_flag display_errors off
php_flag html_errors off
php_flag log_errors off

#hide index.php
<ifModule mod_rewrite.c>
#Turn on the engine
RewriteEngine on
#Don't Perform for files and directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#Exerything else redirect to index.php
RewriteRule ^(.*)$ index.php/$1
</ifModule>
Redirect 301 /donate /funding
Redirect 301 /site/donate /funding

这是我的vhost

<Directory {{ www_path }}>
        Options Indexes MultiViews FollowSymLinks
        AllowOverride All
</Directory>

0 个答案:

没有答案