I just noticed on my website, with a link checker, that I have a bunch
of URL's that reference a directory *above* my document root directory,
but IE/Firefox/Opera never let on - they just seem to ignore the '../'
I have in front of my links. Can this behavior be correct?
So, my page is at this URL:
And one of the links on that page, which has no 'base href' tags or
anything else, says:
<a href="../somedir/somepage.html"> Link here</a>
My doc root is here:
/www
And my 'somedir' is here:
/www/somedir
but the URL, that I would expect to be broken, is not - it refers to:
/somedir
but the browser ignores the '../' directory references, apparently,
once it reaches document root, and then dives down. In the case above,
the initial page was served from document root, so there's no place
left to go, but down.
[color=blue]
>From quick testing, it also seems I can have a link with the following[/color]
that would *still* work:
<a href="../../../../../../../../../somedir/somepage.html"> Link
here</a>
It just doesn't seem right. Basically, if the URL references something
higher than document root, then ignore that part of the URL?
I'm all for leniency, but this just doesn't make any sense to me. Do I
have it right? That the browsers just say 'ah, we knew what she meant
anyways'?
of URL's that reference a directory *above* my document root directory,
but IE/Firefox/Opera never let on - they just seem to ignore the '../'
I have in front of my links. Can this behavior be correct?
So, my page is at this URL:
And one of the links on that page, which has no 'base href' tags or
anything else, says:
<a href="../somedir/somepage.html"> Link here</a>
My doc root is here:
/www
And my 'somedir' is here:
/www/somedir
but the URL, that I would expect to be broken, is not - it refers to:
/somedir
but the browser ignores the '../' directory references, apparently,
once it reaches document root, and then dives down. In the case above,
the initial page was served from document root, so there's no place
left to go, but down.
[color=blue]
>From quick testing, it also seems I can have a link with the following[/color]
that would *still* work:
<a href="../../../../../../../../../somedir/somepage.html"> Link
here</a>
It just doesn't seem right. Basically, if the URL references something
higher than document root, then ignore that part of the URL?
I'm all for leniency, but this just doesn't make any sense to me. Do I
have it right? That the browsers just say 'ah, we knew what she meant
anyways'?
Comment