Credit portal




What does forward slash mean

what does forward slash mean

As mentioned by @RandomBen. the double slash is most likely the result of an error somewhere.

That the page loads has nothing to do with the browser. but rather that the server ignores the extra slash. The browser doesn't do anything special with extra slashes in the URL, it just sends them along in the request:

It looks like current versions of Apache and IIS both will ignore the extra slashes while resolving the path and return the document that would have been returned had the URL not had extra slashes. However. browsers (I tested IE 8 and Chrome 9) get confused by any relative URLs (containing parent path components) of resources in the page, which produces bad results. For example, if a page has:

Upon loading the page /a/b/c/. the browser will request /a/style.css. But if—for whatever reason— /a/b//c/ is requested (and the server ignores the extra slash), the browser will end up requesting /a/b/style.css. which won't exist. Oops, the page looks ugly.

(This obviously won't happen if the URL doesn't have a parent path component (. ) or is absolute.)

It is my opinion that Apache and IIS (and probably others) are acting incorrectly as /a/b/c/ and /a/b//c/ technically represent two different resources. According to RFC 2396. every slash is significant:

So, /a/b/c/ consists of three segments: "a", "b", and "c"; /a/b//c/ actually consists of four: "a", "b", "" (the empty string), and "c". Whether or not the empty string is a valid filesystem directory is a detail of the server's platform. (And logically, this means the browsers are actually operating correctly when parsing relative URLs with parent path components – in my example, they go up past the "c" directory and the "" directory, leaving us to request style.css from "b".)

If you're using Apache with mod_rewrite. there is a pretty simple fix :

This will issue a HTTP 301 Moved Permanently redirect so that any double slashes are stripped out of the URL.

Category: Forex

Similar articles: