Re: xaraya header responses (bug 1155) : possible/partial fixes

Jason <[email protected]> Tue, 07 Jul 2009 17:14:20 +0100
Newsgroups gmane.comp.cms.xaraya.devel
Organization Xaraya
Message-ID <[email protected]>
Roger Rogerson wrote:
> ...
> As I have you here, I'm looking for a method to spot incorrect URL to Xarpage issues.
> As it currently stands, if I have a parent page (PageA), and a child page (PageA1) ...then delete the child page - anyone following a link to the child page ends up viewing the parent page.

Yes, that is by design. The path matches the page that has the most parts to the
path, and any additional parts to the path are passed to the page to do with as
it likes. A page could display news items, for example, based on the title:

e.g. /path/to/my/page/the-title-of-the-article-which-is-not-a-xarpage

If you want to raise an error, then a custom api function
(xarpages/xarfuncapi/...) could be written. That function would simply look for
any additional path parts and raise an error if there were any. You would need
to add the function to every page though, at least those pages where you do
specifically want an error to be raised.

Each page can also have its own custom short URL decoder and encoder, so that
may be an additional place where could raise an error. The custom URL decoder is
 meant to be the place to decode those additional parts to the path anyway.

Another possible approach would be to use the canonical URL tag
(http://yoast.com/canonical-url-links/). When a page is selected in the
short-URL decode in xarpages, the canonical tag can be set to the actual URL,
i.e. the shortest path that matches the current page. That way search engines,
having stumbled upon a parent page after a child page has been removed, will see
that the two URLs are equivalent, and would remove all but one of the pages from
it index (without hurting your ranking). You would probably put the tag into the
'meta' block template. It wouldn't hurt to use the canonical tag across all the
modules, especially articles where the same article can be displayed against
many different URLs.


> thus;
>    /pagea/pagea1
>    ?module=xarpages&func=display&pid=2
> ends up showing the contents of
>    /pagea/pagea
> 
>    ?module=xarpages&func=display&pid=1
> 
> I need to figure a way of internally figuring out that the contents displayed is Not the content for that URL - so I can send the right response.
> (else it stil lsends a 200, and I could end up with copies of the parent page showing).
> 
> 
> If I was using system URLs it may be possible, but with Short URLs I don't see anyway to identify things :(
> 
> Any ideas how I can check whether what is asked for and what is displayed matches?
> 
> .
> 
> Aside from that question - Thanks for the contact.
> Very much appreciated, and I hope you are well,

Yep - very well and very busy. There are just too many pies I would like to get
my fingers into, but can barely lick the pastry on each :-)

-- Jason