最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

redirect - Wordpress site not forcing from http to https instead getting redirected too many times

programmeradmin6浏览0评论

This is what I have done so far. In the settings in the admin I have updated the url to https e.g

But if i was to visit a page for example and remove https://www. from the url it would not redirect to and instead serve up the non secure link.

So i have tried adding a rewriterule in the htaccess file for example this

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ /$1 [R=301,L,NE]

In the hope that it would capture any non-secure link and redirect it to the secure link (this is what i would normally use for non-wordpress sites)

I have also tried

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

This is a duplicated question but I have tried all the other examples but nothing has worked.

发布评论

评论列表(0)

  1. 暂无评论