Skip to content

Instantly share code, notes, and snippets.

@sajupro
Created April 7, 2020 18:10
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 sajupro/577574714eef1cb57a9dde25121f2c0a to your computer and use it in GitHub Desktop.
Save sajupro/577574714eef1cb57a9dde25121f2c0a to your computer and use it in GitHub Desktop.
Redirect all www urls to non-www with .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment