Hi,
The recent discussion about ".html" at the end of paths reminded me... I've been wondering about the reason why a trailing slash is not allowed in aliases created by the Path module.
Sometimes when I land on a page deep in a website, I want to see more of what the website is about. So I go up a few folders manually... eg. I read
www.example.com/articles/internet/whyinternetisgood.html, then I manually enter the following into the URL: www.example.com/articles/ in order to see the index page containing all the articles.
This reflects the basic function of HTML/HTTP. Obviously Drupal doesn't work like that, under Drupal you would probably need to go to www.example.com/articles. I wouldn't mind being able to mimic the traditional functionality for users like myself that do "manual navigation".
Any thoughts?
"Obviously Drupal doesn't work like that"
Works just fine for me... I just tried it on my site. If I leave the trailing slash on, it just takes it off and goes to that page.
Michelle
On Sat, May 3, 2008 at 9:56 PM, John Fletcher net@twoedged.org wrote:
Hi,
The recent discussion about ".html" at the end of paths reminded me... I've been wondering about the reason why a trailing slash is not allowed in aliases created by the Path module.
Sometimes when I land on a page deep in a website, I want to see more of what the website is about. So I go up a few folders manually... eg. I read
www.example.com/articles/internet/whyinternetisgood.html, then I manually enter the following into the URL: www.example.com/articles/ in order to see the index page containing all the articles.
This reflects the basic function of HTML/HTTP. Obviously Drupal doesn't work like that, under Drupal you would probably need to go to www.example.com/articles. I wouldn't mind being able to mimic the traditional functionality for users like myself that do "manual navigation".
Any thoughts?
-- [ Drupal support list | http://lists.drupal.org/ ]
Responses inline below.
On 5/3/08, John Fletcher net@twoedged.org wrote:
The recent discussion about ".html" at the end of paths reminded me... I've been wondering about the reason why a trailing slash is not allowed in aliases created by the Path module.
There's an issue about it here: http://drupal.org/node/250525
Sometimes when I land on a page deep in a website, I want to see more of what the website is about. So I go up a few folders manually... eg. I read
www.example.com/articles/internet/whyinternetisgood.html, then I manually enter the following into the URL: www.example.com/articles/ in order to see the index page containing all the articles.
That sounds like "hackable URLs" to me.
Any thoughts?
Sure, I created a video a while ago that discusses hackable URLs and then shows how to achieve this using Pathauto and Views: http://blip.tv/file/817271
Enjoy! Greg
Thanks Greg,
Was reading the page you linked to and it brought me to this comment which seems to be a worthy consideration http://drupal.org/node/160753#comment-257061, probably more worthy than actually being able to hack the URL. Global redirect appears to address the issue.
Regards, John.
-----Original Message----- From: Greg@GrowingVentureSolutions.com [mailto:Greg@GrowingVentureSolutions.com] Sent: Sunday, 4 May 2008 9:41 PM To: support@drupal.org Subject: Re: [support] Path trailing slash
Responses inline below.
On 5/3/08, John Fletcher net@twoedged.org wrote:
The recent discussion about ".html" at the end of paths reminded me...
I've
been wondering about the reason why a trailing slash is not allowed in aliases created by the Path module.
There's an issue about it here: http://drupal.org/node/250525
Sometimes when I land on a page deep in a website, I want to see more of what the website is about. So I go up a few folders manually... eg. I
read
www.example.com/articles/internet/whyinternetisgood.html, then I manually enter the following into the URL: www.example.com/articles/ in order to
see
the index page containing all the articles.
That sounds like "hackable URLs" to me.
Any thoughts?
Sure, I created a video a while ago that discusses hackable URLs and then shows how to achieve this using Pathauto and Views: http://blip.tv/file/817271
Enjoy! Greg
what the website is about. So I go up a few folders manually... eg. I read
www.example.com/articles/internet/whyinternetisgood.html, then I manually enter the following into the URL: www.example.com/articles/ in order to see the index page containing all the articles.
This reflects the basic function of HTML/HTTP. Obviously Drupal doesn’t
Unofrtunately, you're very confused. This is not a basic function of HTML and HTTP but, rather, a side-effect of how the Apache webserver handles filesystem requests. In short: if the requested destination maps to a directory, then *Apache* (the webserver, not your browser, not the website software) will append a trailing slash - to indicate that this is a directory.
In a traditional Drupal example:
http://www.example.com/node/123 http://www.example.com/node
Neither of those Drupal URLs map to any literal file or directory on the file system Your base assumption - that you can then "go up a few folders" is inherently inaccurate, because *there are no folders*.
Take a look, for example, at:
http://www.disobey.com/detergent
This is a literal directory on my filesystem. If you attempt to go to that URL, you will see that Apache (the webserver) will issue an immediate and barely perceptible redirect which will send your browser to the URL with a trailing slash instead. Apache will *only* ever do this for directories. It's not going to do this for URLs served from a website's content management system, such as example.com/node above.
This even works for the base URL:
Notice there's no trailing slash - but, if you enter just the above into a browser, you'll see that Apache does the same barely perceptible redirect and you'll reach http://www.disobey.com/. One could almost infer that you can save scant ten thousandths of a second if you always append literal directories with a trailing slash - if you don't, Apache will just have to do it for you anyways (note that I've been following this practice forever - see my signature for instance).
As Michelle followed up, though, Drupal, the website software, will gladly accept a trailing slash *if the requested destination has content to serve*. Both of these URLs work:
http://www.disobey.com/node http://www.disobey.com/node/
Drupal is making them work because it knows that "node" is a valid destination inside the software. Compare, on the other hand:
http://www.disobey.com/taxonomy/term/18 http://www.disobey.com/taxonomy/term/18/
Both of those URLs work, but not this one:
http://www.disobey.com/taxonomy/term http://www.disobey.com/taxonomy/term/
Because there's nothing inside Drupal that exists at that destination (thus, it gives the standard "Page not found" error). You would certainly, however, be able to define your own node, and then alias both of the above URLs, if you so chose.
Your biggest problem is, however:
* You've misunderstood that path components of a URL directly map to a filesystem's directory/file structure; they don't.
* You've misunderstood that *every* literal directory/file structure allows you to browse up the hierarchy by just removing parts of the path. Compare, for example:
http://www.disobey.com/misc/druplicon.png http://www.disobey.com/misc/
These are literal files and directories, but one can't browse the /misc/ directory (in this case, because it's been denied, but whether Apache's DirectoryIndex is properly configured is also another measure of success).
* You've misunderstood that Drupal (or any website software) can't replicate this functionality; it can.
Well that was an exciting discussion. Actually Michelle and others were right - it does actually work as I had hoped. So I'm happy. I must have never actually tested just putting a trailing slash on the URL!
In response to Morbus: Traditionally websites in HTML were built around a literal directory and file structure. A website would normally have an index document for each of its folders. I know Drupal is not built around a literal structure. But the user does not realise they are interacting with a Drupal site and thus may assume the literal folder structure and try to "hack the URL" as Greg called it.
Granted, if you site navigation is good enough they should never have to try this. Anyway as said I now know I can build my paths in a way that all my URLs will be "hackable", so thanks everyone.
Regards, John.
-----Original Message----- From: Morbus Iff [mailto:morbus@disobey.com] Sent: Monday, 5 May 2008 12:46 AM To: support@drupal.org Subject: Re: [support] Path trailing slash
what the website is about. So I go up a few folders manually... eg. I read
www.example.com/articles/internet/whyinternetisgood.html, then I manually enter the following into the URL: www.example.com/articles/ in order to see the index page containing all the articles.
This reflects the basic function of HTML/HTTP. Obviously Drupal doesn�t
Unofrtunately, you're very confused. This is not a basic function of HTML and HTTP but, rather, a side-effect of how the Apache webserver handles filesystem requests. In short: if the requested destination maps to a directory, then *Apache* (the webserver, not your browser, not the website software) will append a trailing slash - to indicate that this is a directory.
In a traditional Drupal example:
http://www.example.com/node/123 http://www.example.com/node
Neither of those Drupal URLs map to any literal file or directory on the file system Your base assumption - that you can then "go up a few folders" is inherently inaccurate, because *there are no folders*.
Take a look, for example, at:
http://www.disobey.com/detergent
This is a literal directory on my filesystem. If you attempt to go to that URL, you will see that Apache (the webserver) will issue an immediate and barely perceptible redirect which will send your browser to the URL with a trailing slash instead. Apache will *only* ever do this for directories. It's not going to do this for URLs served from a website's content management system, such as example.com/node above.
This even works for the base URL:
Notice there's no trailing slash - but, if you enter just the above into a browser, you'll see that Apache does the same barely perceptible redirect and you'll reach http://www.disobey.com/. One could almost infer that you can save scant ten thousandths of a second if you always append literal directories with a trailing slash - if you don't, Apache will just have to do it for you anyways (note that I've been following this practice forever - see my signature for instance).
As Michelle followed up, though, Drupal, the website software, will gladly accept a trailing slash *if the requested destination has content to serve*. Both of these URLs work:
http://www.disobey.com/node http://www.disobey.com/node/
Drupal is making them work because it knows that "node" is a valid destination inside the software. Compare, on the other hand:
http://www.disobey.com/taxonomy/term/18 http://www.disobey.com/taxonomy/term/18/
Both of those URLs work, but not this one:
http://www.disobey.com/taxonomy/term http://www.disobey.com/taxonomy/term/
Because there's nothing inside Drupal that exists at that destination (thus, it gives the standard "Page not found" error). You would certainly, however, be able to define your own node, and then alias both of the above URLs, if you so chose.
Your biggest problem is, however:
* You've misunderstood that path components of a URL directly map to a filesystem's directory/file structure; they don't.
* You've misunderstood that *every* literal directory/file structure allows you to browse up the hierarchy by just removing parts of the path. Compare, for example:
http://www.disobey.com/misc/druplicon.png http://www.disobey.com/misc/
These are literal files and directories, but one can't browse the /misc/ directory (in this case, because it's been denied, but whether Apache's DirectoryIndex is properly configured is also another measure of success).
* You've misunderstood that Drupal (or any website software) can't replicate this functionality; it can.
Quoting John Fletcher net@twoedged.org:
Hi,
Hi, I've changed the subject to match the question.
The recent discussion about ".html" at the end of paths reminded me... I've been wondering about the reason why a trailing slash is not allowed in aliases created by the Path module.
Because you don't want to end up with a URL like foo//bar. Follow the rules and your won't have an issue.
Sometimes when I land on a page deep in a website, I want to see more of what the website is about. So I go up a few folders manually... eg. I read
www.example.com/articles/internet/whyinternetisgood.html, then I manually enter the following into the URL: www.example.com/articles/ in order to see the index page containing all the articles.
This has nothing to do with the path aliases.
This reflects the basic function of HTML/HTTP. Obviously Drupal doesn't work like that, under Drupal you would probably need to go to www.example.com/articles. I wouldn't mind being able to mimic the traditional functionality for users like myself that do "manual navigation".
Drupal is a CMS that displays data in HTML format. Drupal itself doesn't do the URL translations for the HTML request, that is the job of your server like Apache.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/