Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo Forums URL
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Forums Feedback
View previous topic :: View next topic  
Author Message
abzs2k
Apprentice
Apprentice


Joined: 17 Jan 2004
Posts: 181
Location: London, UK

PostPosted: Sun May 23, 2004 3:07 pm    Post subject: Gentoo Forums URL Reply with quote

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
View user's profile Send private message
squeegy
Guru
Guru


Joined: 13 Mar 2004
Posts: 321
Location: Cincinnati, OH

PostPosted: Sun May 23, 2004 3:17 pm    Post subject: Reply with quote

Wow, never noticed that before, it does look exteremely different. What would cause such a thing?
Back to top
View user's profile Send private message
abzs2k
Apprentice
Apprentice


Joined: 17 Jan 2004
Posts: 181
Location: London, UK

PostPosted: Sun May 23, 2004 3:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
amne
Bodhisattva
Bodhisattva


Joined: 17 Nov 2002
Posts: 6377
Location: Graz / EU

PostPosted: Sun May 23, 2004 9:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
chino_
Apprentice
Apprentice


Joined: 05 Apr 2004
Posts: 184
Location: Berlin

PostPosted: Sun May 23, 2004 9:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
equilibrium
Apprentice
Apprentice


Joined: 29 Jun 2003
Posts: 213
Location: UK

PostPosted: Sun May 23, 2004 10:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
tomk
Administrator
Administrator


Joined: 23 Sep 2003
Posts: 7095
Location: Sat in front of my computer

PostPosted: Sun May 23, 2004 10:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
progster
Apprentice
Apprentice


Joined: 16 Jul 2002
Posts: 271

PostPosted: Sun May 23, 2004 10:47 pm    Post subject: Reply with quote

that's because of your browser (and btw the correct url would be http://forums.gentoo.org/index/ iirc) it will look for all the files in your base directory (in your case being index.php), but since that doesn't exist the images, css, and all other files can't be located...

~Progster
_________________
report dups :: boycott cedega/winex! :: lan party with linux support! (dutch)
Back to top
View user's profile Send private message
abzs2k
Apprentice
Apprentice


Joined: 17 Jan 2004
Posts: 181
Location: London, UK

PostPosted: Mon May 24, 2004 1:23 pm    Post subject: Reply with quote

amne wrote:
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?


I found something. Slightly ironic where it comes from.

MSDN wrote:
Code:
// The URI is a fully qualified URI and MUST include the
// terminating '/'

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/http/http/http_server_sample_application.asp
_________________
I am never wrong. I am simply misinterpreted.
*This User Observes Netiquette Compliance*
Back to top
View user's profile Send private message
progster
Apprentice
Apprentice


Joined: 16 Jul 2002
Posts: 271

PostPosted: Mon May 24, 2004 2:37 pm    Post subject: Reply with quote

well that may be so and the server handles it correctly, the problem is your browser doesn't...

~Progster
_________________
report dups :: boycott cedega/winex! :: lan party with linux support! (dutch)
Back to top
View user's profile Send private message
amne
Bodhisattva
Bodhisattva


Joined: 17 Nov 2002
Posts: 6377
Location: Graz / EU

PostPosted: Mon May 24, 2004 6:13 pm    Post subject: Reply with quote

abzs2k wrote:

I found something. Slightly ironic where it comes from.

:D
_________________
Dinosaur week! (Ok, this thread is so last week)
Back to top
View user's profile Send private message
stonent
Veteran
Veteran


Joined: 07 Aug 2003
Posts: 1139
Location: Texas

PostPosted: Wed May 26, 2004 8:05 am    Post subject: Reply with quote

Take this link

http://www.microsoft.com/MSPress/books/7169.asp

Throw a slash on the end and watch what happens.


http://www.microsoft.com/MSPress/books/7169.asp/

Indeed.
_________________
Inspiron 4100 & Sun UltraAXe
Portage on Solaris|Dell Laptop Hacks
The way you feel about organized religion is the same way I feel about organized socialism.
Back to top
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722
Location: Cluj-Napoca, Romania

PostPosted: Wed May 26, 2004 10:20 am    Post subject: Re: Gentoo Forums URL Reply with quote

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
View user's profile Send private message
abzs2k
Apprentice
Apprentice


Joined: 17 Jan 2004
Posts: 181
Location: London, UK

PostPosted: Wed May 26, 2004 4:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Forums Feedback All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum