【问题标题】:.htaccess rewrites one url, not the other.htaccess 重写一个 url,而不是另一个
【发布时间】:2012-04-25 20:27:09
【问题描述】:

我已经设置了这组.htaccess 重写(Zend Framework 默认重写规则):

重写引擎开启
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
重写规则 ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

我的DocumentRoot 文件夹仅包含.htaccessindex.php,没有其他内容。

重写规则应该通过 index.php 将所有请求发送到不存在的文件。 这发生在/herp/derp/(无论控制器是否存在),但不适用于/index/herp/ 或任何其他以/index/ 开头的url。

所有/index/* url都被路由到apache的404页面,所有其他url都可以。

我应该如何解决这个问题?

【问题讨论】:

    标签: .htaccess mod-rewrite apache2.2


    【解决方案1】:

    原来 MultiViews 可以做到这一点。仍然不知道为什么:P

    【讨论】:

      猜你喜欢
      • 2014-07-02
      • 1970-01-01
      • 1970-01-01
      • 2017-05-21
      • 1970-01-01
      • 1970-01-01
      • 2015-07-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多