https.png
Redirecting HTTP to HTTPS
1. Redirect All Web Traffic
If you have existing code in your .htaccess, add the following:
2. Redirect Only a Specific Domain
For redirecting a specific domain to use HTTPS, add the following:
3. Redirect Only a Specific Folder
Redirecting to HTTPS on a specific folder, add the following:
Note: Replace “yourdomain” with your actual domain name wherever required. Also, in case of the folder, replace /folder with the actual folder name.
Redirecting HTTP to HTTPS
1. Redirect All Web Traffic
If you have existing code in your .htaccess, add the following:
Code:
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
For redirecting a specific domain to use HTTPS, add the following:
Code:
RewriteEngine On RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
Redirecting to HTTPS on a specific folder, add the following:
Code:
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} folder RewriteRule ^(.*)$ https://www.yourdomain.com/folder/$1 [R,L]
Note: Replace “yourdomain” with your actual domain name wherever required. Also, in case of the folder, replace /folder with the actual folder name.
Comment