Oliver Baltzer wrote:
> On 12/06/07 07:10 PM, John W. Long was heard to say:
>> 
>> * 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

The interesting thing with Radiant is that it eliminates possible the 
namespace confusion of something like:
 root
  |- A (folder)
  |  |- index (file)
  |- A (file)

which made distinguishing between example.com/a and example.com/a/ 
necessary for browsers in the first place.

So, you can safely choose to add slashes or not for EVERY file and know 
that it'll all work out.

That said, I'd prefer to represent each page as a file to the browser 
(i.e. example.com/a) unless someone has a compelling reason it should be 
treated like a folder.  In addition, this method cleans up the whole 
extension parsing (who cares if it's a CSS file -- nothing gets a 
slash).

@John,
So, how about a Radiant configuration setting to either "strip all 
trailing slashes" or "don't mess with my slashes dude (current 
behavior)"?

I guess a third option could be 'force trailing slashes' (but someone 
else can contribute that one :P ).

-Chris

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
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