Home · Latest · Trends  /  Apache
4

htaccess redirect http to https

rated 4 times [  4] [ 0]  / comments: 1 / hits: 569  / 1 year ago, sat, jun 23, 2018, 11:07:37
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
More From » Apache
 

Comments

1
This code work for me
Code:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com\folder
RewriteRule ^(.*)$ https://www.example.com\folder/$1 [R,L]
[#9] Friday, July 27, 2018, 14:34:15
 
Ronald
commented 1 year ago
Only authorized users can post. Please sign in first, or register a free account
 
Share
Snippets
1 year ago, mon, may 21, 2018
8 months ago, sun, jan 20, 2019
8 months ago, sun, jan 20, 2019
Sponsor
Posted
my3profile

my3profile

Member since May 21, 2018
Total Code Snippets: 4
Total Comments: 1
Location: n/a
Following
User not following anyone yet.