Skip to content

Instantly share code, notes, and snippets.

@dogmatic69
Created October 3, 2010 22:32
Show Gist options
  • Save dogmatic69/609008 to your computer and use it in GitHub Desktop.
Save dogmatic69/609008 to your computer and use it in GitHub Desktop.
redirecting your sub domains
<IfModule mod_rewrite.c>
RewriteEngine on
# redirect all www traffic to non-www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# normal cakephp stuff
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment