Should the canonical tag point to the rewritten URL of the page even if it doesn't have a valid directory structure?

Should the canonical tag point to the rewritten URL of the page even if it doesn't have a valid directory structure? - 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 Should the canonical tag point to the rewritten URL of the page even if it doesn't have a valid directory structure? error on your web browser. Problem :


The structure of my url is http://www.somesomewebsite.com/ShowProduct.aspx?ID=12.



I am doing a permanent redirect (301) to http://www.somewebsite.com/product-category/12/this-is-my-product-name/. However if the user types just http://www.somewebsite.com/product-category/12/ he/she is given a 404 error.



What should my Canonical URL point to?



http://www.somesomewebsite.com/ShowProduct.aspx?ID=12


OR



http://www.somewebsite.com/product-category/12/this-is-my-product-name/

Solution :

The canonical URL should be the URL you want Google to show in their search results. So:



http://www.somewebsite.com/product-category/12/this-is-my-product-name/


When making URLs available to the public, always try the friendly URL approach instead of the old fashioned approach. This means you want:



http://www.somewebsite.com/product-category/12/this-is-my-product-name/



I am doing a permanent redirect (301) to http://www.somewebsite.com/product-category/12/this-is-my-product-name/. However if the user types just http://www.somewebsite.com/product-category/12/ he/she is given a 404 error.




This URL:



http://www.somewebsite.com/product-category/12/


doesn't get crawled by anything unless it is advertised anywhere on the web (including your website) without the "nofollow" keyword included in the anchor tag pointing to the link.



For example, submitting the above link to a sitemap will cause the search engine to crawl it.



The above link producing a 404 does not need attention at this time until you are almost ready to make it public.


We hope that this article has helped you resolve the seo, redirects, url-rewriting 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=