Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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. –  articlestack Oct 11 '10 at 12:16

1 Answer 1

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

 
discard

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.