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?


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


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  • Unfortunately it still doesn't work :( Please check again - the code is now live. – kacper3355 Apr 13 '20 at 23:00
  • It's password protected :/ – gcoulson Apr 13 '20 at 23:02
  • I mean, you can go to monersi.pl and it will work as it should. But if you try to visit any other page, for example monersi.pl/tatatatatata you will see that the SSL doesn't work - even if the website is password protected :/ – kacper3355 Apr 13 '20 at 23:08
  • Have you gone through your settings and made sure everything is set to https://, specifically General Settings -> Wordpress Address (URL) and General Settings -> Site Address (URL)? – gcoulson Apr 14 '20 at 0:43
  • Yes, everything is set to https :/ – kacper3355 Apr 14 '20 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.