0

I know this has been asked a million times, but I can't make heads or tails out of the gobbly gook answers I found when searching. All I need is a very simple .htaccess rule where if someone accesses my site with the www, it will remove it, so http://www.example.com --> http://example.com

Thanks!

zoldos
  • 45
  • 1
  • 12
  • possible duplicate of [Generic htaccess redirect www to non-www](http://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www) – Dom Jun 05 '14 at 09:45

1 Answers1

0

Write on .htaccess:

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

Reference:Generic htaccess redirect www to non-www

Community
  • 1
  • 1
Omar Sedki
  • 608
  • 6
  • 14