Android, Java, PHP, Linux, Databases and other funny things.
I'm doing, I'm learning, I post it here.
Thursday, September 20, 2012
htaccess non-www and www http to https
RewriteEngine on
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} =on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
<Files .htaccess>
order allow,deny
deny from all
</Files>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment