Apache 当我将http重定向到https时,会出现500个内部服务器错误

Apache 当我将http重定向到https时,会出现500个内部服务器错误,apache,.htaccess,Apache,.htaccess,当我使用以下代码将http重定向到https时: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 它给出了500个内部服务器错误 /home/siggle/public_html/.htaccess:命令无效 “\xef\xbb\xbfWriteEngine”,可能拼写错误或由模块定义 不包括在服务器配置中 您需要在服务器上安装UR

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

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
它给出了500个内部服务器错误

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


您需要在服务器上安装URL重写模块:

您的服务器上可能未启用<代码>mod rewrite。您可以在服务器配置文件中使用
AllowOverride All
,或者让托管服务提供商为您启用它。好的,我将尝试设置AllowOverride All-托管服务提供商说httpd.conf文件无法访问共享托管!在htaccess中执行,当我在htaccess ErrorDocument 404/404-page.html ErrorDocument 404/404-image.jpg中添加这个时,问题仍然存在!请帮忙