4

Right now my site runs on http://www.example.com but I need to run that without www also i.e example.com

Can some body tell me here that how can i do that?

2
  • Why do you need this? Most of the I have read recommend the opposite, redirecting non-www visitors to www. Commented Oct 11, 2010 at 11:26
  • From SEO point of view, any one of them ie either www -> non www or vice versa is required. Commented Oct 11, 2010 at 12:16

1 Answer 1

2

This is very simple using .htaccess file, simply add:

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

Simply place .htaccess file on the root folder/directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.