Hello all.. My site open as mydomain.com and it can also be opened by www.mydomain.com, www.mydomain.com/index.php, mydomain.com/index.php so it can be accessed by four different URLs so how can i solve this issue?, can link canonical tag helps in it?, kindly explain me by giving examples. Thanks in advance
Simply use htaccess to redirect all of those pages to the one you want. so if you want www.mydomain.com to be the main one. use 301 redirects to send all visitors to that url. It won't hurt your seo at all, in fact it will help it. I don't know the code off the top of my head, but do a google search for "htaccess index rewrite" or something along those lines.
you only use canonical tag when you want to show 4 separate URLs to your users, but want to avoid duplicate content penalty from search engines, so you tell them to index only one url of 4 in your case your probably just want to redirect non-www to www and index.php to / using mod_rewrite in .htaccess
To over come the duplicate content from Search Engines then you can use canonical tag to redirect it. I do not know how to give you correct suggestion.
Dear Kalpit, The best solution of you above problem is to implement 301 (permanent) redirection of all version of your home page to final one. For example; if you want to show www.domainname(dot)com version to search engine. Redirect all other version to this version using various method depending upon your hosting. - If your website hosted on linux sever you can implement permanent redirection using .htaccess file - if you website is hosted on windows server, you can implement this through webconfig file Regarding to canonical tag, as mentioned by atfsurf; it is only recommended when you are having different url with same content on your website. hope it will help !!
thanks for some of the good suggestions, i have tried link canonical tag and 301 redirects in .htaccess file but canonical tag is not providing 301 redirects it only suggest to search engine about other canonical URLs, i have also tried to find out the code to redirect from non-www to www and paste it in to .htaccess file but it didn't work, i used the correct code as i have find out from many authenticated sources but it didn't work so kindly help me out for this problem..
Hi, Take a help with 301 redirection in which you can do prefer your domain for the the Google as well as visitors too other than also this tag <link rel="canonical" href="yourdomian dot com" />.
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
A canonical problem exists were a site can be found by using the www Version and the non www. version. This creates a problem because it can be seen as duplicate content by the search engines and one version can be removed from their indexes - the problem arises when the wrong version is deleted (this is usually the non www. version) Redirect WWW to non-WWW: RewriteEngine On RewriteCond %{HTTP_HOST} !^(yourdomain\.com)?$ RewriteRule ^(.*)$ http://%{HTTP_HOST}$1 [R=301,L] Redirect non-WWW to WWW: RewriteEngine On RewriteCond %{HTTP_HOST} !^(www\.yourdomain\.com)?$ RewriteRule ^(.*)$ http://www.%{HTTP_HOST}$1 [R=301,L]
Can you explain how canonical tag can redirect your website? Kindly post reply if you know what you are writing !!
A canonical link element is an html element that helps webmasters prevent duplicate content issues by specifying the "canonical", or "preferred", version of a web page as part of SEO