Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2019-12-17 06:39:21
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 8,460
- Website
[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.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.
Offline
#2 2019-12-17 15:13:04
- etc
- Developer
- Registered: 2010-11-11
- Posts: 4,066
- Website
Offline
#3 2019-12-17 15:27:43
- colak
- Admin
- From: Cyprus
- Registered: 2004-11-20
- Posts: 8,460
- Website
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.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.
Offline
#4 2019-12-17 15:37:20
- etc
- Developer
- Registered: 2010-11-11
- Posts: 4,066
- Website
Offline
Pages: 1