| View previous topic :: View next topic |
| Author |
Message |
abzs2k Apprentice


Joined: 17 Jan 2004 Posts: 181 Location: London, UK
|
Posted: Sun May 23, 2004 3:07 pm Post subject: Gentoo Forums URL |
|
|
Ocasionally I get carried away with some things. Normally to get to the forums I just select the url from the drop down list for type in:
http://forums.gentoo.org/.
However, today in my attempt to write a full URI into the address bar (Mozilla) i typed in:
http://forums.gentoo.org/index.php/
I remember reading somewhere that a fully qualified URI must always end in a / but in doing so the site didnt render properly.
Anybody? _________________ I am never wrong. I am simply misinterpreted.
*This User Observes Netiquette Compliance* |
|
| Back to top |
|
 |
squeegy Guru


Joined: 13 Mar 2004 Posts: 321 Location: Cincinnati, OH
|
Posted: Sun May 23, 2004 3:17 pm Post subject: |
|
|
| Wow, never noticed that before, it does look exteremely different. What would cause such a thing? |
|
| Back to top |
|
 |
abzs2k Apprentice


Joined: 17 Jan 2004 Posts: 181 Location: London, UK
|
Posted: Sun May 23, 2004 3:34 pm Post subject: |
|
|
I am guessing the style sheets are not being applied.
EDIT: I just realised none of the links work either. _________________ I am never wrong. I am simply misinterpreted.
*This User Observes Netiquette Compliance* |
|
| Back to top |
|
 |
amne Bodhisattva


Joined: 17 Nov 2002 Posts: 6377 Location: Graz / EU
|
Posted: Sun May 23, 2004 9:33 pm Post subject: |
|
|
| Looks like the page without CSS. I'm not sure if your theory about URLs ending with a slash is conclusive, anything to back it up? |
|
| Back to top |
|
 |
chino_ Apprentice


Joined: 05 Apr 2004 Posts: 184 Location: Berlin
|
Posted: Sun May 23, 2004 9:53 pm Post subject: |
|
|
seeing that I love the actual design even more  _________________ always the same old taste, just new injury
well i'll wear the claws if you'd like that
yeah if you'd like that we can ride on a black horse
a great new wave hesperian death horse |
|
| Back to top |
|
 |
equilibrium Apprentice


Joined: 29 Jun 2003 Posts: 213 Location: UK
|
Posted: Sun May 23, 2004 10:01 pm Post subject: |
|
|
hehe now that's real minimalist
it also seems to happen on other websites
I tried it on my website - http://eq.equk.co.uk/index.php/
looks very ugly _________________ kernel 3.9.2-2-ck | openbox | github |
|
| Back to top |
|
 |
tomk Administrator


Joined: 23 Sep 2003 Posts: 7095 Location: Sat in front of my computer
|
Posted: Sun May 23, 2004 10:27 pm Post subject: |
|
|
I've been messing about to see if I could find out what is happening. This is what I've come up with, but I may be wrong.
I think that php is treating the extra slash on the end as an argument to index.php as is the case with the arguments after the question mark. You can try this with something like this:
http://forums.gentoo.org/index.php/blah/whatever/blah
But when the HTML code is outputted from the php it gets the current directory from the URI, working backwards to the first slash; So any references to CSS files or images will be relative to the last directory in the URI, which doesn't exist.
I'm pretty sure that's what's happening. _________________ Search | Read | Answer | Report | Strip |
|
| Back to top |
|
 |
progster Apprentice


Joined: 16 Jul 2002 Posts: 271
|
|
| Back to top |
|
 |
abzs2k Apprentice


Joined: 17 Jan 2004 Posts: 181 Location: London, UK
|
|
| Back to top |
|
 |
progster Apprentice


Joined: 16 Jul 2002 Posts: 271
|
|
| Back to top |
|
 |
amne Bodhisattva


Joined: 17 Nov 2002 Posts: 6377 Location: Graz / EU
|
Posted: Mon May 24, 2004 6:13 pm Post subject: |
|
|
| abzs2k wrote: |
I found something. Slightly ironic where it comes from.
|
 _________________ Dinosaur week! (Ok, this thread is so last week) |
|
| Back to top |
|
 |
stonent Veteran


Joined: 07 Aug 2003 Posts: 1139 Location: Texas
|
|
| Back to top |
|
 |
moocha Watchman

Joined: 21 Oct 2003 Posts: 5722 Location: Cluj-Napoca, Romania
|
Posted: Wed May 26, 2004 10:20 am Post subject: Re: Gentoo Forums URL |
|
|
| abzs2k wrote: | I remember reading somewhere that a fully qualified URI must always end in a / but in doing so the site didnt render properly.
Anybody? |
Nope.
First of all, what you type in the browser address bar are almost always URLs. Now, any URL is also an URI, but not all URIs are URLs (in other words, URLs are a subset or URIs).
| RFC2396 wrote: | | The term "Uniform Resource Locator" (URL) refers to the subset of URI that identify resources via a representation of their primary access mechanism (e.g., their network "location"), rather than identifying the resource by name or by some other attribute(s) of that resource. |
The trailing slash is simply part of the path component of the URL. It does by no means indicate a "fully qualified URL". In fact, there is no such beast as a "fully qualified URL" as defined by any RFC - what you probably were thinking of were fully qualified domain names, which are something else entirely.
| RFC2396 wrote: | | The path may consist of a sequence of path segments separated by a single slash "/" character. |
The trailing path simply causes the server to see the last segment of the URL to be an empty segment. Now, under normal circumstances, the last segment of the path component indicates the specific resource which to fetch from the location identified by the hierarchy of the preceding path segments. In case the last path component is empty, the server will usually (but isn't required to!) fetch a "default" resource from that location. Exactly how this "default" resource is defined is up to the server - it isn't specified by any standard.
In less strict terms, you can formulate it like this: The path component functions like an Unix-style path. The individual segments can be compared to directories, and the last segment is always the file (with the difference that those directories aren't required to actually exist - one can create virtual ones via aliases and what have you). If the file part is empty, a default file is returned - for example, for Apache it's whatever you put after the DirectoryIndex directive in the configuration (index.html or index.htm or index.php etc), for IIS it's similar except you specify it somewhere in it's configuration tool (defaults to Default.htm IIRC), and so on and so forth.
If you watch the actual HTTP requests being performed when you fetch something like http://host.name.here/directory you'll see that the server will return a 302 Moved Temporarily response redirecting to http://host.name.here/directory/ (note the trailing slash), which will in turn get you the "default" resource as explained above.
That much for URLs - for more info, see RFC2396 (Uniform Resource Identifiers (URI): Generic Syntax).
| RFC2396 wrote: | | Within a query component, the characters ";", "/", "?", ":", "@", "&", "=", "+", ",", and "$" are reserved. |
In other words, they've got a special meaning, don't use them casually.
Now, by appending a slash to the index.php part you've basically told Apache to not return the index.php "default file", but to look for a "directory" named index.php and return the default file from inside it. Now, since such a directory is unlikely to exist, a PHPized Apache will actually be nice enough to still invoke index.php through the PHP interpreter - but with a subtly altered environment.
Appending the slash will cause several PHP variables to have unexpected values - for example, _SERVER["PHP_SELF"] will no longer have the (correct) value "index.php" but it will have the value "index.php/", (which in turn messes the CSS up - but this is PHPbb-specific - other PHP software may exhibit a different behavior), _SERVER["PATH_INFO"] will no longer be empty (it'll contain "/"), and _SERVER["REQUEST_URI"] will also contain "index.php/" instead of "index.php".
So basically what you're experiencing when you add that trailing slash is undefined and depends on the exact software that you're running on the remote server. It may work, it may generate incorrect responses or responses that render incorrectly, or it may not work at all. YMMV. _________________ Military Commissions Act of 2006: http://tinyurl.com/jrcto
"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin |
|
| Back to top |
|
 |
abzs2k Apprentice


Joined: 17 Jan 2004 Posts: 181 Location: London, UK
|
Posted: Wed May 26, 2004 4:10 pm Post subject: |
|
|
I guess then I was wrong. Thanks for clearing that up though. _________________ I am never wrong. I am simply misinterpreted.
*This User Observes Netiquette Compliance* |
|
| Back to top |
|
 |
|