Skip to content

Instantly share code, notes, and snippets.

View xpharsh's full-sized avatar

Harsh Gupta xpharsh

View GitHub Profile
@hugodias
hugodias / .htaccess
Last active August 17, 2018 15:21
CakePHP First HTACCESS for redirect from non-www to www
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteCond %{HTTP_HOST} !=localhost [NC]
RewriteCond %{HTTP_HOST} !=127.0.0.1
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on