【问题标题】:when i redirect http to https it gives 500 internal server error当我将 http 重定向到 https 时,它会出现 500 内部服务器错误
【发布时间】:2018-07-22 01:30:55
【问题描述】:

当我使用此代码将 http 重定向到 https 时:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

它给出 500 内部服务器错误。

/home/siggle/public_html/.htaccess: 无效命令 '\xef\xbb\xbfRewriteEngine',可能拼写错误或由模块定义 不包含在服务器配置中

【问题讨论】:

  • 您的服务器上可能没有启用mod-rewrite。您可以在服务器配置文件中使用AllowOverride All 或要求您的托管服务提供商为您启用它。
  • 好的,我试试,谢谢
  • 如何设置 AllowOverride All - 托管服务提供商表示共享托管无法访问 httpd.conf 文件!并在 htaccess 中执行说当我在 htaccess ErrorDocument 404 /404-page.html ErrorDocument 404 /404-image.jpg 中添加此问题时,问题仍然存在!请帮忙

标签: apache .htaccess


【解决方案1】:

您需要在服务器上安装 URL-rewrite 模块: https://www.iis.net/downloads/microsoft/url-rewrite

【讨论】:

    猜你喜欢
    • 2017-10-01
    • 2018-08-06
    • 1970-01-01
    • 2016-12-12
    • 1970-01-01
    • 2014-01-04
    • 1970-01-01
    • 1970-01-01
    • 2014-01-30
    相关资源
    最近更新 更多