If domain.com and www.domain.com has same content, Google will think it as duplicate content. However, you can use .htaccess to avoid duplicate content. Solution is to redirect your visitor to one of the domain, either with www or without www. The trick below is a simple yet effective way to avoid duplicate content on the same domain.
To avoid duplicate content using.htaccess, follow the steps below:-
Advertisements
- Open you .htaccess file located at your public_html folder
- Copy and append the code below to your .htaccess
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
- Save your .htaccess file and try to enter domain.com at your browser and it should be redirect you to www.domain.com automatically now.
Related posts:
Prestashop: How to disable ajax add to cart?
How to extract password rar file in command line - Linux
Symfony: PHP Fatal error: Call to a member function setData()
How to mount samba in Mac OS X / Linux?
How to setup gmail to receive other POP3 email?
How to add Primary and Secondary DNS server - /etc/resolve.conf - Linux
15GB of Online Cloud Storage for FREE!
How to setup SSH without password
Share this with your friends:-