不工作我最近启用SSL在网站上(https://ledertid.com)HTTPS在.htaccess重定向网页
我用这个在我的.htaccess重定向从http一切://到https:// 。
这是我原来的.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
然后我尝试这个(选项A)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{ENV:HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
以上选项一个在浏览器返回以下错误: “ledertid。 com重定向你太多次了。“
然后我尝试这个(选项B)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
选项C
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{HTTPS} !=on
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
它像所有的URL除了主页的魅力。因此,如果您访问http:// ledertid.com,它不会将您重定向到https://版本。
在.htaccess中我的重写规则有问题吗?或者我缺少导致此问题的其他内容?
非常感谢你。
嗯.. 这没有奏效。以某种方式打破整个页面太多的重定向页面。 我没有删除其他重写,但仍然没有工作 –