【发布时间】: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 中添加此问题时,问题仍然存在!请帮忙