Making sure all your guest are coming in through the same url can be important for SEO. Google may see your domain as two sites depending how you use the WWW and non-WWW url. If Google does pickup both your WWW and non-WWW WordPress site, you may get flagged for duplicate content.

To mitigate these problems, it can be useful to force all users through the same url. For example, on this site, going to http://www.dave.kz/* will be 301 redirected to http://dave.kz/*. To force everyone to use the same URL, open up your .htaccess file. It should look something like this:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

You’ll need to add these two lines. Make sure you put them in the exact same place.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^dave.kz
RewriteRule (.*) http://dave.kz/$1 [R=301,L]

RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Make sure you replace the “!^dave.kz” and “http://dave.kz/” with your domain.

8 Comments

  1. 郫县华伟包装厂

    我辈国人 不怕一战 草 就算回到解放前 我们也认了 不愿再这么懦弱下去了 国家啊 给我们一个向前冲的信号 让我们也扬眉吐气一下 美国拟个战争贩子 麻痹的 真打起来 就是中国剩下最后一人也要炸你五角大楼 再给你个911
    郫县华伟包装厂 http://www.cdhwms.com

  2. 房山网站建设

    还是我们老祖宗说对,人善被人欺,马善被人骑. 真不知道中国政府怕什么?怕美国吗?那个人不知道美国人怕核弹. 胆小的怕胆大的,胆大的怕不要命的,美国人不是sb,要是真打起来,他会为了一个小国家把自己命和国家陪上去,所以中国政府不要在沉默了,我宁愿战死,也不想让人羞辱,气死.
    房山网站建设 http://www.fswzjs.com.cn/

Leave a Reply

Your email address will not be published. Required fields are marked *