【问题标题】:htacces 500 Internal Server Errorhtaccess 500 内部服务器错误
【发布时间】:2017-04-05 10:03:27
【问题描述】:

我正在尝试使用 htacces 将 URL 栏中显示的 html 扩展名(如 www.mywebsite.com/about.html)重写为 www.mywebsite.com/about。

这是我正在使用的代码,但它似乎不起作用。谁能告诉我为什么这不起作用?非常感谢任何答案和/或解释!

ErrorDocument 404 /404.html

Options +FollowSymLinks

RewriteEngine On
RewriteRule ^home index.html
RewriteRule ^about about.html
RewriteRule ^services services.html

【问题讨论】:

  • 您必须查看 Apache 错误日志(请咨询您的主机以了解这些日志的位置)以获取有关错误的详细信息。我的猜测是你有重写循环,因为像^services 这样的模式会匹配/services/services.html,然后无限重写为services.html。您可能只需要将[L] 标志添加到这些并终止它们,如^services$
  • 错误日志说明了什么?
  • 错误日志显示如下:myurl/.htaccess: Option FollowSymLinks not allowed here
  • @MichaelBerkowski 你知道是什么导致了这个问题吗?

标签: .htaccess


【解决方案1】:

好的,看来我的托管服务提供商不提供 .htacces 文件。 (就像 F ......)。谢谢大家一起思考。干杯

【讨论】:

    猜你喜欢
    • 2016-09-22
    • 1970-01-01
    • 2013-02-06
    • 2015-06-28
    • 2016-04-20
    • 2014-01-01
    • 2018-05-10
    • 2011-07-09
    相关资源
    最近更新 更多