Greenguy's Board


Go Back   Greenguy's Board > General Business Knowledge
Register FAQ Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
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
Old 2005-03-28, 02:29 AM   #2
Chop Smith
Eighteen 'til I Die
 
Chop Smith's Avatar
 
Join Date: Apr 2003
Location: Mississippi
Posts: 2,168
Send a message via ICQ to Chop Smith
Some of your clients might appreciate you doing a script to solve the problem discussed in this thread http://www.greenguysboard.com/board/...ad.php?t=18000
__________________
Chop Smith is offline   Reply With Quote
Old 2005-03-28, 03:08 AM   #3
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
Quote:
Originally Posted by Chop Smith
Some of your clients might appreciate you doing a script to solve the problem discussed in this thread http://www.greenguysboard.com/board/...ad.php?t=18000
Thanks for reminding me of that.
I sure wish I could remember what I did on that
for someone else. It took a while but I eventually
developed something that worked quite well.
I do have an idea that should work pretty well, though.
Did you say you have some free galleries to try it out on?
__________________
Ray Morris
support@bettercgi.com
Strongbox/Throttlebox & more
TXDPS #A14012
raymor is offline   Reply With Quote
Old 2005-03-28, 03:31 AM   #4
Chop Smith
Eighteen 'til I Die
 
Chop Smith's Avatar
 
Join Date: Apr 2003
Location: Mississippi
Posts: 2,168
Send a message via ICQ to Chop Smith
About 270. Let me know what you need
__________________
Chop Smith is offline   Reply With Quote
Old 2005-03-28, 02:33 PM   #5
Barron
You tried your best and you failed miserably. The lesson is 'never try'
 
Join Date: Oct 2004
Posts: 166
http://httpd.apache.org/docs/misc/rewriteguide.html


Trailing Slash Problem
Description:
Every webmaster can sing a song about the problem of the trailing slash on URLs referencing directories. If they are missing, the server dumps an error, because if you say /~quux/foo instead of /~quux/foo/ then the server searches for a file named foo. And because this file is a directory it complains. Actually is tries to fix it themself in most of the cases, but sometimes this mechanism need to be emulated by you. For instance after you have done a lot of complicated URL rewritings to CGI scripts etc.
Solution:
The solution to this subtle problem is to let the server add the trailing slash automatically. To do this correctly we have to use an external redirect, so the browser correctly requests subsequent images etc. If we only did a internal rewrite, this would only work for the directory page, but would go wrong when any images are included into this page with relative URLs, because the browser would request an in-lined object. For instance, a request for image.gif in /~quux/foo/index.html would become /~quux/image.gif without the external redirect!
So, to do this trick we write:

RewriteEngine on
RewriteBase /~quux/
RewriteRule ^foo$ foo/ [R]


The crazy and lazy can even do the following in the top-level .htaccess file of their homedir. But notice that this creates some processing overhead.

RewriteEngine on
RewriteBase /~quux/
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [R]


-
Barron is offline   Reply With Quote
Old 2005-03-28, 02:38 PM   #6
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
Leaving off the trailing slash is just one of the problems that I see.

I've seen sites that use file paths and names like "members/last year 1998/friend's of Foo/Babe's big blue outfit that she got for Christmas.jpg"
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2005-03-28, 03:31 PM   #7
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
Note that the "solution" Barron posted truly is as it says
for "the crazy and lazy". The sane avoid making linsk like that
in the first place.
__________________
Ray Morris
support@bettercgi.com
Strongbox/Throttlebox & more
TXDPS #A14012
raymor is offline   Reply With Quote
Old 2005-03-28, 03:34 PM   #8
Barron
You tried your best and you failed miserably. The lesson is 'never try'
 
Join Date: Oct 2004
Posts: 166
Quote:
Originally Posted by raymor
Note that the "solution" Barron posted truly is as it says
for "the crazy and lazy". The sane avoid making linsk like that
in the first place.

yep!


-
Barron is offline   Reply With Quote
Old 2005-03-29, 05:45 PM   #9
ecchi
Banned
 
ecchi's Avatar
 
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
RE:"The sane avoid making linsk like that
in the first place." Yeah, but where do you go to get clients with this level of intelligence. Most of mine are so thick I am surprised that they don't die from forgetting to breathe.
ecchi is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:30 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc