How to redirect non-www site to www site?

Posted by Mohan Ahire on Stack Overflow See other posts from Stack Overflow or by Mohan Ahire
Published on 2012-04-04T12:47:29Z Indexed on 2012/04/04 23:29 UTC
Read the original article Hit count: 152

Filed under:
|

I have created one wordpress site. As I write domain name without www then it opens correctaly but as I write www. in url it's not showing the site.

Please help me.. Thank you in advance.

I have edited my question and added the following part :

Following is my file : Where I have to put code provided by you ? I tried it before the "Begin Wordpress" line but still not working.

plugable.php

-FrontPage-

IndexIgnore .htaccess /.?? *~ *# /HEADER */README* */_vti*

order deny,allow

deny from all

allow from all

order deny,allow

deny from all

AuthName example.com

AuthUserFile /home/example/public_html/_vti_pvt/service.pwd

AuthGroupFile /home/example/public_html/_vti_pvt/service.grp

BEGIN WordPress

RewriteEngine On

RewriteBase /

RewriteRule ^index.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

END WordPress

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about redirection