Mobile app version of vmapp.org
Login or Join
Debbie626

: 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

@Debbie626

Posted in: #Htaccess #Php #Redirects

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Debbie626

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme