【问题标题】:.htaccess file is not working on Apache Server.htaccess 文件在 Apache 服务器上不起作用
【发布时间】:2010-11-10 14:08:54
【问题描述】:

我在 www.hostmoster.com 上托管了我的网站,我已经编写了用于 URL 重写的 .htaccess 文件,自去年以来它一直在正常工作.. 但是今天他们在他们的 Apache 服务器中进行了一些升级.. 现在我的 .htaccess 文件无法正常工作。我的文件内容是

RewriteEngine on
RewriteRule ^$ /index.php [L]
RewriteCond $1 !^(index\.php|functions\.php|showpopup\.php|signup\.php|chat|tmp|extras|services|flash|data|images|forum|business|css|scripts|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]

请帮帮我.. Apache Server 版本是 2.2.11.. 我面临的问题是,对于每个页面请求,它都会打开 index.php 页面

【问题讨论】:

  • 向 Hostmonster 支持咨询。你付钱给他们,他们应该能够帮助你,特别是如果问题出在他们的配置中。
  • 问问他们升级后发生了什么变化。
  • 在最后一行我进行了更改,我已将 [L] 更改为 [R].. 它已经开始工作.. 但它现在在 URL 中显示 index.php.. 任何建议

标签: apache .htaccess hosting


【解决方案1】:

也许……

注意:

如果你想调用你的 .htaccess 文件其他东西,你可以改变 文件名使用 AccessFileName 指令。例如, 如果您更愿意调用该文件 .config 然后你可以把以下 在您的服务器配置文件中:

AccessFileName .config

来自Apache docs

【讨论】:

    【解决方案2】:

    我可能有两个原因。一是文件的权限,二是禁止web服务器执行.htaccess。使用此链接检查 apache 配置以执行 .htaccess 文件。

    http://httpd.apache.org/docs/current/howto/htaccess.html

    可以肯定的是,在共享服务器中您不会被允许访问 .conf 文件,但您可以向支持团队提出问题,他们可以帮助您。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-16
      • 2017-05-17
      • 2015-03-20
      • 2013-01-07
      • 2015-07-04
      相关资源
      最近更新 更多