View Single Post
Old 2005-03-28, 01:52 AM   #1
raymor
The only guys who wear Hawaiian shirts are gay guys and big fat party animals
 
Join Date: Jan 2004
Posts: 178
Send a message via ICQ to raymor
Damn people, href="members" is a FILE. href="/members/" is a directory

Well I'm currently doing a search and replace
on the 3rd site today, fixing thousands
of html pages where the webmaster didn't
know how to come up with a correct URL.
So in case anyone reading this doesn't know,
you'll know now. A link like this tries to find
a FILE called "members":
a href="members"
If you want the index page of a directory called "members/" you need the traling slash:
a href="members/"

Many servers are configured to catch this mistake
and redirect the user back to members/ instead.
In the best case, that means that it generates twice as many hits every time someone loads that page. First they ask for members, then the
server tells them to head over to http://yousite.com/members/
instead, then the browser sends another
request for members/.
In the worst case, it can fuck up a lot of shit.
For example that redirect won't work properly
with most of your anti-hotlinking code
or AVS site .htaccess.
So if you didn't know before, now you know if
you're linking to a directory (to get it's index page)
you must end the URL with a slash (/).
__________________
Ray Morris
support@bettercgi.com
Strongbox/Throttlebox & more
TXDPS #A14012
raymor is offline   Reply With Quote