Difference between canonical and base tag

Difference between canonical and base tag - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Difference between canonical and base tag error on your web browser. Problem :


I am a little bit confused regarding the usage of canonical tags and base tags.



I have placed canonical tag (rel="canonical") on my website because of my website opening with no-www. I have reviewed my website through SEO doctor add-ons which is showing that my website is not indexable in search engine. Can anyone can explain this?


Solution :

Canonical Tag



The canonical tag tells search engines what the URL of the current page should be.



<link rel="canonical" href="http://www.example.com/mypage.html" />


tells search engines that the current page should be indexed at http://www.example.com/mypage.html even if they crawl it at http://example.com/mypage.html



Base Tag



The base tag tells all browsers how the URLs of every relative link in the page should start.



<base href="http://www.example.com/">


tells browsers (and crawlers) to open any relative links in such a way that they start with http://www.example.com/. So a link to /myotherpage.html would go to http://www.example.com/myotherpage.html, even if that link were found on http://example.com/mypage.html






Without examining your website itself, I can't tell you why your site isn't able to be indexed. If you add a comment with a link to it, we can take a look at it. Using canonical tags and base tags should not prevent your site from being indexed if you used them correctly.



rel="canonical" solution is frequently used between two pages with same content (not for an entire website). Explanations here.



Base tag is different and used to specify default URL for all relative URLs in the page.



However, keep available two versions of your website (www and no-www versions) can be hasardous because it generates duplicate content. And Google doesn't like duplicate content, that's why it's good seo pratice to redirect www to no-www or the opposite.



If you use Apache HTTP Server as web server, you can create .htaccess file in root of your domain (if it doesn't already exist) and add these lines to redirect (301 redirect) www to no-www:



<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %HTTP_HOST !^example.com [NC]
RewriteRule (.*) http://example.com/$1 [QSA,R=301,L]
</IfModule>


Of course, you replace example.com by your website URL.



You also can choose the opposite (redirect from no-www to www) if you prefer. No matter for seo if you choose one or other solution.



What is important is to implement 301 redirect solution unlike rel="canonical" solution to do this.


We hope that this article has helped you resolve the seo, redirects, search-engine-indexing error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=