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

SSL doesn't work on certain pages - what is wrong?

programmeradmin3浏览0评论

I just added an SSL certificate to my Wordpress website using this code (.htaccess):

# REDIRECT HTTP TO HTTPS RewriteCond %{HTTPS} !=on RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

However, when I type monersi.pl/something in browser, the certificate doesn't work, but when I type monersi.pl, everything is okay. (monersi.pl is my website)

What did I do wrong?

I just added an SSL certificate to my Wordpress website using this code (.htaccess):

# REDIRECT HTTP TO HTTPS RewriteCond %{HTTPS} !=on RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

However, when I type monersi.pl/something in browser, the certificate doesn't work, but when I type monersi.pl, everything is okay. (monersi.pl is my website)

What did I do wrong?

Share Improve this question edited Apr 13, 2020 at 21:24 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Apr 13, 2020 at 21:05 kacper3355kacper3355 772 silver badges9 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

If it's all in one line, it will be commented out at # Redirect HTTP... as the # character is used for commenting in .htacces.

Try:

# REDIRECT HTTP TO HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
发布评论

评论列表(0)

  1. 暂无评论