dimanche 22 juillet 2018

Can't redirect http to https properly

So I'm using the following code to redirect my website from http to https and from www to non-www:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^(.*)$ https://example.com/$1 [R,L]

It's supposed to redirect, but it's not working.

Yes, the "example" word is there on purpose.




Aucun commentaire:

Enregistrer un commentaire