Answers for ".htaccess file redirect if not https"

PHP
0

.htaccess redirect to https

<IfModule mod_rewrite.c>
....
....
# Redirect To HTTPS
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^ https://example.com%{REQUEST_URI} [L,NE,R=301]
...
...
</IfModule>
Posted by: Guest on March-05-2021
0

.htaccess redirect to https

RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1
Posted by: Guest on May-16-2020

Code answers related to ".htaccess file redirect if not https"

Browse Popular Code Answers by Language