Re: URI Style
by perrin (Chancellor) on May 10, 2006 at 18:34 UTC
|
What's stopping you from serving .pl URIs with Ruby? URIs are just RPC requests. They don't have any inherent meaning and a good web server like apache can map them to anything. | [reply] |
Re: URI Style
by Asim (Hermit) on May 10, 2006 at 18:06 UTC
|
Or, on *NIX platforms, simply detail a directory for CGI, and leave off the .pl off the file(s) in question. Of course, then one insures to make only the appropriate files executable...
(You can likely do something similar on IIS, although I can't think of how to make it work, off-hand)
Don't really have an opinion about your philosophy; I agree it's a issue (also: knowing what the backend is can lead to Programming Language-specific crack attempts), although it's not the bug-a-boo to me you find it.
----Asim, known to some as Woodrow.
| [reply] [d/l] |
Re: URI Style
by spiritway (Vicar) on May 10, 2006 at 20:31 UTC
|
Agree with your main comment. Also, I feel it's just good practice to keep as much detail as possible hidden from the public.
| [reply] |
Re: URI Style
by phaylon (Curate) on May 11, 2006 at 09:58 UTC
|
| [reply] |
|
|
What's wrong
- overkill for this issue
- not compiled in by default
- too hard to understand, even with the recipes. I wish the m_r interface would be more perly, but it is constrained by being Apache conf items, after all :(
- (this one's hard to explain, I'll try anyway...) wrong focus: m_r does "just" rewriting; I described but one part of content negotiation. Right now I'm serving all my PNG images with linking to just their basename. I'm in the progress of adding SVG versions, and an advanced UA will prefer the SVG during negotiation (in case both are available and the type has a higher accept value, well you know how it works). m_r does not offer that seamless semantic meaningful switchover in any easily discernable way.
| [reply] |
|
|
| [reply] |
Re: URI Style
by themage (Friar) on May 11, 2006 at 14:24 UTC
|
That's why I don't use .pl or any CGI like software.
I think that URLs must describe their content, not the program used to manage it, SO I use modperl directly, or HTML::Mason, with dhandlers, that allow me to have virtual URLs, that I then map to my database information.
The future (being finished) of my bliki system, Mabliki, uses a urification of the post titles on the URLs, that have the form /view/some-special-interest-item.html.
This is a virtual cached URL, that say nothing about the software used or the language I use, only about the action I 'm doing (viewing some-special-interest-item).
I think there are several reason to use this type of URLs, including compatibility and SEO. URLS like parent=23421;node_id=2342345 say nothing about the content, and even when a user is looking in history for some story he liked it don't work.
mod_rewrite is a good way to transform URLs if you can't have natively good URLs. ModPerl have several ways to map URLs, so I don't think that you need another way to map them.
You just need another way to think web devel in Perl.
CGI, I think, is not an option. Even in a Perl::Registry environment.
| [reply] |
|
|
post titles on the URLs, that have the form /view/some-special-interest-item.html.
This is a virtual cached URL, that say nothing about the software used or the language I use That's good, but improvable.
/view is redundant, as it exposes something system-specific, see the point about cruft above. I know you use mod_rewrite behind the scenes to map it to something, and this part of the URI is actually necessary, so may I suggest renaming it /articles instead?
.html does talk about the language you use. In five years you want to serve the content perhaps in XHTML with embedded namespaces or who knows what wacky stuff comes along and the file ending is entirely unappropriate when someone saves the document locally. You're safe with leaving the ending off.
| [reply] |
|
|
/view is redundant, as it exposes something system-specific, see the point about cruft above. I know you use mod_rewrite behind the scenes to map it to something, and this part of the URI is actually necessary, so may I suggest renaming it /articles instead?
Hi,
You think that I use mod_rewrite, I don't. Ever. I usually use HTML::Mason or ModPerl, and my application maps URLs to Mason components or Perl functions directly.
.html does talk about the language you use. In five years you want to serve the content perhaps in XHTML with embedded namespaces or who knows what wacky stuff comes along and the file ending is entirely unappropriate when someone saves the document locally. You're safe with leaving the ending off.
You're right about this, but if in the future my application start generating XHTML, I can easly change also the link rotines or components to write urls like /view/some-special-interest-item.xhtml, and the only thing that is in my database unformated story is something like [[Some Special Interest Item]], and it's my engine that generates the url for that.
The same way, except for special cases (Google Videos, You tube, etc), I don't have any HTML in my content database, only special formating chars, that can be translated to HTML, XHTML, LaTeX or anything else I need in the future.
That's the way I like it.
| [reply] |
Re: URI Style
by Anonymous Monk on May 14, 2006 at 14:31 UTC
|
<Directory />
Options MultiViews
</Directory>
File extensions are not necessary with MultiViews for as long as filenames before the extension are all unique. Problem solved, without needing mod_rewrite or setting handlers. | [reply] [d/l] |