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?

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

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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