【问题标题】:mod rewrite RewriteRule always directs to index.php when it shouldn'tmod_rewrite RewriteRule 总是在不应该的时候重定向到 index.php
【发布时间】:2014-08-07 14:47:04
【问题描述】:

我已经在 http://htaccess.madewithlove.be/ 上测试了这个问题,但是当我在本地 ubuntu apache 网络服务器上测试时,它失败了。

请求是:

http://example.com/creator/main/narwhal

适用于其他命令的我的 .htaccess 文件是:

RewriteEngine on
RewriteRule ^creator/main/([^/.]+)/?$ /about.html [L]

由于某种原因,我得到的结果是:

找不到

在此服务器上找不到请求的 URL /index.php。

Apache/2.2.22 (Ubuntu) 服务器位于 68.56.177.238 端口 8080

我的 .htaccess 文件中没有 index.php 的实例,那么它为什么要在那里重定向?非常感谢您的帮助。

【问题讨论】:

  • 检查您的 Apache 配置是否有重写规则。
  • 没有引用索引,或者其中的 index.php。
  • 请将全部内容粘贴到 htaccess 文件中。
  • 想通了。子目录中有另一个 htaccess 文件搞砸了。

标签: apache .htaccess mod-rewrite rewrite


【解决方案1】:

得到了这个。子目录中有另一个 htaccess 文件导致了奇怪的重定向。

【讨论】:

    猜你喜欢
    • 2018-04-03
    • 2018-08-28
    • 1970-01-01
    • 1970-01-01
    • 2012-10-15
    • 1970-01-01
    • 2011-07-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多