Answers for "htaccess redirect all ssl https"

PHP
0

force ssl htaccess

Drop this in a .htaccess file to redirect http to https

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Posted by: Guest on March-23-2021
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

Browse Popular Code Answers by Language