Fri, December 13, 2019, 12:04:52
 
Home · Latest · Trends  /  Apache
4

htaccess redirect http to https

rated 4 times [  4] [ 0]  / comments: 1 / hits: 744  / 2 years 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
Username
 
Your Comment
 
Share
Snippets
2 years ago, mon, may 21, 2018
12 months ago, sun, jan 20, 2019
12 months ago, sun, jan 20, 2019
Posted
my3profile

my3profile

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