Redirecting non www to www in CakePHP using app/webroot
snippet in htaccess

Redirecting non www to www in CakePHP using app/webroot

user665

<IfModule mod_rewrite.c>
  RewriteEngine On

  RewriteCond %{HTTP_HOST} !^www\.myapp\.com [NC]
  RewriteRule ^(.*)$ http://www.myapp.com/$1 [R=301,L]

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>