eci_kluczbork Posted April 28, 2021 Share Posted April 28, 2021 (edited) Good morning.I need help. How do I add a self-canonical tag in the head section of a page so that each URL points to itself? What should the code look like? (variable for url) PRESTASHOP 1.6 Edited April 28, 2021 by eci_kluczbork (see edit history) Link to comment Share on other sites More sharing options...
CedCommerce Team Posted May 6, 2021 Share Posted May 6, 2021 Self - referencing canonical tags will be added automatically by using yoast SEO. Use the advance section on each post or page. Code looks like this: <link rel=“canonical” href=“https://example.com/sample-page/” /> link rel=“canonical”: Master canonical version for the page href=“https://example.com/sample-page/”: canonical version Link to comment Share on other sites More sharing options...
Nickz Posted May 7, 2021 Share Posted May 7, 2021 Since the yoast bug put millions of pages into free fall around 2018-19 I would be careful with yoast. Link to comment Share on other sites More sharing options...
atupuxi Posted June 10, 2021 Share Posted June 10, 2021 (edited) An alternative to using canonical tags is to implement a rel="canonical" HTTP header. This is the implementation approach that you need to take to specify a canonical URL for PDFs or other non-HTML documents. You need to be able to access your site's .htaccess file to implement this and can specify a canonical URL using the following code: <Files "file-to-canonicalize.pdf"> Header add Link "< http://www.website.com/canonical-page/>; rel=\"canonical\"" </Files> Edited June 10, 2021 by atupuxi (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now