On 12/06/07 07:10 PM, John W. Long was heard to say:
> Oliver Baltzer wrote:
>> I agree and support the idea of generally redirecting URLs without a 
>> trailing slash to URLs with trailing slash. I know it is easily done 
>> with every Web server in front of Radiant, but I think this should be 
>> part of Radiant. My only concern about generally enforcing this is that 
>> other document types (images, PDFs, etc.) end up with a trailing slash 
>> as well. Some context-based redirect would solve that, by asking the 
>> addressed page/object to redirect to its canonical URL.
> 
> I would accept a patch that implements this in the following fashion:
> 
> * URLs without file extensions automatically get redirected to URLs with
>    trailing slashes
> * URLs with extensions (like .css or .xml) are left alone
> * There is a configuration variable that turns this behavior on or off

Hi John,

thanks for your input. I do not think that the file extension is in
the general case a good indication for whether a URL should have a
trailing slash or not [1]. The canonical URL of a resource should be
determined by its corresponding model. ATM, everything in Radiant is a
page whether it is HTML or CSS. I would suggest the site controller
uses Page#url to determine the canonical URL of a page and redirects
accordingly. Page#url or any derived form of it is then responsible of
deciding if a trailing slash should be added. If we then want to have
CSS and XML without trailing slashes, we can just add a new derived
page model that computes the canonical URL differently.

[1] http://www.w3.org/Provider/Style/URI

Cheers,
Oliver

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to