Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[SOLVED] canonical urls in search results bug?
I know that it is questionable if search results should have canonical urls but I have this meta tag for them:
<txp:if_search>
<link rel="canonical" href="<txp:site_url trim="/" /><txp:page_url />" />
</txp:if_search>
the parsed result of which is
<link rel="canonical" href="http://www.site.tld/?m=any&q=query" />
Copying and pasting the url returns a 404 because of the &
. I think that the result should be:
<link rel="canonical" href="http://www.site.tld/?m=any&q=query" />
Would it validate though?
I also tried
<link rel="canonical" href="<txp:site_url trim="/" context /><txp:page_url />" />
which again returned the same url
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline
Re: [SOLVED] canonical urls in search results bug?
Interesting
<link rel="canonical" href="<txp:site_url trim="/" /><txp:page_url escape="" />" />
validates just fine! I guess that the validator understands the content!
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline