Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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 Gupta Oct 11 '10 at 12:16
up vote 1 down vote accepted

This is very simple using .htaccess file.

You just need to place following lines in your .htaccess

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]

RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

You would have to place .htaccess file on root of your site.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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