【问题标题】:htacces after ErrorDocument redirect url remains unchangeErrorDocument 重定向 url 后的 htaccess 保持不变
【发布时间】:2013-03-10 03:26:44
【问题描述】:

我正在阻止 htaccess 列出目录,但在它被定向到索引后,url 不会改变。

如果用户访问http://www.searchme.com/images

它将页面重定向到主页,但网址保持不变http://www.searchme.com/images

因此,如果我单击任何链接,则 URL 将变为 http://www.searchme.com/images/about.php 而应该变为 http://www.searchme.com/about.php

 #IndexIgnore /images/*
 Options -Indexes
 ErrorDocument 404 /searchme/index.php
 ErrorDocument 403 /searchme/index.php

【问题讨论】:

  • .htaccess 文件中的全部内容?
  • 是的,我想在用户访问图像文件夹时重定向到 index.php,但重定向后 url 不会改变
  • 通过网址我的意思是地址栏网址不会改变

标签: php .htaccess mod-rewrite


【解决方案1】:

我应该在错误文档中提及整个路径

     Options -Indexes
     ErrorDocument 404 http://127.0.0.1/musaada/index.php
     ErrorDocument 403 http://127.0.0.1/musaada/index.php

【讨论】:

    猜你喜欢
    • 2013-11-15
    • 2011-12-01
    • 2021-10-13
    • 2015-09-05
    • 2012-11-13
    • 1970-01-01
    • 1970-01-01
    • 2018-02-19
    • 2012-04-19
    相关资源
    最近更新 更多