Get rid of your www.
February 1st, 2009
Here’s a handy tip, if you want to remove the www. from your domain and have visitors always see http://mydomain.com, then all you have to do is add 4 lines of code to your .htaccess file (or create a .htaccess file if you dont have one already). Just add: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^mydomain.com$ [NC] RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301] Just replace “mydomain” with the name of your domain and you’re done. Thats it! Now any time someone goes to www.mydomain.com the www. will be automatically dropped. The one caveat, your server has to be running the apache webserver…