: How to set up a rel=canonical in PHP? I'm trying to add the rel=canonical tag to only one page. In order to add the tag, I need to add it to the part, in the mod_header.php file. This
I'm trying to add the rel=canonical tag to only one page. In order to add the tag, I need to add it to the part, in the mod_header.php file. This will add the same rel canonical tag to all the pages of my website.
How can I add rel canonical to only one page. I don't want to do a 301 redirect, I want to add a rel=canonical tag.
Can this be done with some .htaccess code?
More posts by @Debbie626
1 Comments
Sorted by latest first Latest Oldest Best
Add to htaccess:
<Files "file.html">
Header add Link "<http://www.example.com>;rel="canonical""
</Files>
For further info read: moz.com/blog/how-to-advanced-relcanonical-http-headers
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.