|
|
|
|
|
|
|
![]() |
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
![]() |
#1 |
The only guys who wear Hawaiian shirts are gay guys and big fat party animals
|
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 (/). |
![]() |
![]() |
![]() |
#2 |
Eighteen 'til I Die
|
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
|
![]() |
![]() |
![]() |
#3 | |
The only guys who wear Hawaiian shirts are gay guys and big fat party animals
|
Quote:
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? |
|
![]() |
![]() |
![]() |
#4 |
Eighteen 'til I Die
|
About 270. Let me know what you need
|
![]() |
![]() |
![]() |
#5 |
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] - |
![]() |
![]() |
![]() |
#6 |
Subversive filth of the hedonistic decadent West
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" |
![]() |
![]() |
![]() |
#7 |
The only guys who wear Hawaiian shirts are gay guys and big fat party animals
|
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. ![]() |
![]() |
![]() |
![]() |
#8 | |
You tried your best and you failed miserably. The lesson is 'never try'
Join Date: Oct 2004
Posts: 166
|
Quote:
yep! ![]() - |
|
![]() |
![]() |
![]() |
#9 |
Banned
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. |
![]() |
![]() |
![]() |
|
|