Answers for "how to redirect www to https using htaccess"

PHP
0

htaccess redirect to https

RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^yourdomain\.com [OR]
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com
RewriteRule .* https://yourdomain.com%{REQUEST_URI} [R=301,L]
Posted by: Guest on September-26-2020
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

force http to https htaccess

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L,NE]
Posted by: Guest on May-30-2020
-1

http redirect to https htaccess

RewriteEngine On 
RewriteCond %{HTTPS} !on 
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$ 
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$ 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Posted by: Guest on October-30-2020
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 "how to redirect www to https using htaccess"

Browse Popular Code Answers by Language