http://example.com
http://www.example.com
Both of the above mentioned urls will have the same content therefore canonicalizing each other. To resolve this issue we 301 redirect one of the url to other. Mostly we 301 redirect non www url to the one with www.
This can be done simply by adding the following code in the .htaccess file:
###########FOR example.com to www.example.com########### RewriteEngine on Rewritecond %{http_host} ^example.com [nc] Rewriterule ^(.*)$ http://www.example.com/$1 [r=301,nc] #########################################################
For any queries or questions, feel free to comment.
No comments:
Post a Comment