Use A Canonical Url, Amongst Page Url Conditionals

Not all spider web log owners tin sack successfully add together a conditional display of a template object, to their blog.

Some owners carefully re-create the conditional code that I provide, add together it to their blogs - together with it does non operate (for them). In around cases, it may work, for me, when I cheque their work.

Conditional code, that involves people inward countries dependent area to the province specific domain redirect, won't ever hold upwards comparing against "blogspot.com". People inward the U.K. may run across their spider web log equally "blogspot.co.uk", for instance.

Related


People inward the USA, correct now, volition ever run across BlogSpot blogs, equally "blogspot.com".

This blog, together with other blogs published to custom domains, volition ever hold upwards viewed nether their domain URLs - then at that topographic point is no worry nearly province specific domain redirect.

How create you lot compare a spider web log URL, amongst province specific domain redirects inward use?

But what of blogs published to "blogspot.com", exterior the USA? How create they conditionally display objects, amongst the conditional URL varying according to the province specific code of each reader?

When you lot create a URL comparison, to conditionally display a template object - together with the spider web log is published to "blogspot.com" - cheque against the canonical URL.

Use the canonical URL, for conditional comparisons inward BlogSpot blogs.

Since your spider web log could hold upwards read past times readers inward whatever country, if your spider web log is published to "blogspot.com", you lot volition desire to base of operations whatever URL comparing against the Canonical URL.
  • Compare "data:blog.canonicalUrl" - non "data:blog.url".
  • Compare against the URL, ending inward "blogspot.com".

Your readers could hold upwards inward whatever province - either the same equally you, together with dependent area to your province local domain - if 1 applies. Or, they could hold upwards dissimilar from you, together with dependent area to a dissimilar province local domain - again, if 1 applies.

<b:if cond='data:blog.canonicalUrl != "http://mypersonalblog.blogspot.com"'> <style> #Text1 {display: none !important;} </style> </b:if>

or possibly

<b:if cond='data:blog.canonicalUrl != data:blog.homepageUrl'> <style> #Text1 {display: none !important;} </style> </b:if>




Just avoid using

<b:if cond='data:blog.url != "http://mypersonalblog.blogspot.com"'> <style> #Text1 {display: none !important;} </style> </b:if>

and

<b:if cond='data:blog.url != data:blog.homepageUrl'> <style> #Text1 {display: none !important;} </style> </b:if>

This way, everybody inward every dissimilar province tin sack run across the gadgets exclusively when necessary, equally you lot design. And maybe, you lot tin sack cheque your spider web log using a service similar GeoPeeker.

---

Blogger spider web log owners, inward around countries exterior the USA, occasionally detect that they cannot conditionally display template objects, inward BlogSpot published blogs, equally people inward the USA tin sack do.

Owners who alive inward the USA may non realise that people exterior the USA may non run across their blogs properly, amongst conditionals added. If you lot desire your spider web log gadgets to display properly, inward BlogSpot published blogs, purpose a canonical URL inward the comparisons.

Related Posts

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel