Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Double content
Hi folks.
I’ve got some double indexed Urls on a website (http://my-domain.com/article and http://my-domain.com/article/). Which best practice to avoid it?
Note: I’m using smd_short_url plugin.
Thanks for your ideas.
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Re: Double content
rel=‘canonical’ for instance. Place it to the head and use your basic navigation tags such as the permlink and the section to generate appropriate URLs for each page. For an individual article is as simple as:
<link rel="canonical" href="<txp:permlink />" />
Offline
Re: Double content
Pat64 wrote:
Note: I’m using smd_short_url plugin.
That’s got a tag to generate canonical links like Gocom posted (well, sort of):
<txp:if_individual_article>
<txp:smd_canonical />
</txp:if_individual_article>
Except the tag uses rev=
instead of rel=
because someone told me that was right. I’m not so sure now. Either way, if you don’t want that and wish to roll your own, you can specify the type="url"
attribute and it’ll just return you the link to the article. Except you might as well use <txp:permlink>
for that.
*shrug* plugin not well thought through :-)
Last edited by Bloke (2012-08-30 15:00:25)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Offline
Re: Double content
Hi Guys :)
Tks for your answers, mate.
I’m still using canonical links. Sorry, my fault: that’s not a duplicate Urls problem… just a meta description one… with duplicate Urls, too!
Google Webmaster Tools says:
“You’ve got a double meta description on some pages:
- http://my-domain.com/section/
- http://my-domain.com/section/?pg=2
- http://my-domain.com/section/?pg=3
- http://my-domain.com/section
So, I can personalize each page generated with pagination – even if TXP has a problem with the first page – but what can I do with my section?
Here is my doctype content:
<txp:if_individual_article> <link rel="canonical" href="<txp:permlink />"><txp:else /> <link rel="canonical" href="http://my-domain.com<txp:page_url />"></txp:if_individual_article>
Is there a difference with the ending slash between the two tags <txp:permlink />
and <txp:page_url />
?
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Pages: 1