Skip to content

Instantly share code, notes, and snippets.

@rxnlabs
Created April 14, 2014 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rxnlabs/10642148 to your computer and use it in GitHub Desktop.
Save rxnlabs/10642148 to your computer and use it in GitHub Desktop.
htaccess - redirect non-www to www and stop subdomains from redirecting to folder
#redirect non-www to www and stop subdomains from redirecting to folder
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment