Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/273.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 为什么apache mod_rewrite没有正确路由/索引?_Php_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

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

Php 为什么apache mod_rewrite没有正确路由/索引?,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,工作正常: 当转到/index.php时,将加载站点主页 当转到/sdagkljahsdf/sdfsafdsaf/站点(框架)404时 通过index.php加载 工作不正常: 当转到/index时,apache错误消息附带Not 找到:在此服务器上找不到请求的URL/索引。 因此,使用apaches404不通过框架index.php 我想让它通过index.php 这是我的.htaccess: SetEnv APPLICATION_ENV [] php_flag display_err

工作正常:

  • 当转到
    /index.php
    时,将加载站点主页

  • 当转到
    /sdagkljahsdf/sdfsafdsaf/
    站点(框架)404时 通过
    index.php加载

工作不正常:

  • 当转到
    /index
    时,apache错误消息附带
    Not
    找到
    在此服务器上找不到请求的URL/索引。
因此,使用apaches
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

你还有其他规则吗?@starkeen就是这样,除了一些
php_标志
s和一些
301重定向
扫描你发布的完整htaccess之外?@starkeen我已经更新了它
<Directory {{ www_path }}>
        Options Indexes MultiViews FollowSymLinks
        AllowOverride All
</Directory>