GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Damn people, href="members" is a FILE. href="/members/" is a directory (https://gfy.com/showthread.php?t=449166)

raymor 03-27-2005 11:52 PM

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 (/).

Xplicit 03-27-2005 11:54 PM

Ok :thumbsup

bringer 03-27-2005 11:57 PM

blah blah blah

colpanic 03-28-2005 01:35 AM

Well, members could be a cgi script with / as pathinfo.

But I'm just being a pain in the ass, you are 99% right

:winkwink:

emthree 03-28-2005 01:53 AM

What are you using to mass replace?
I have some shit I need to edit too. I'm thinking of purchasing MTR(Mass Text Replacer)

kaktuz 03-28-2005 01:57 AM

how bout text editor? :)
or its a tgext to replace mass PAGES?

raymor 03-28-2005 10:18 AM

Quote:

Originally Posted by emthree
What are you using to mass replace?
I have some shit I need to edit too. I'm thinking of purchasing MTR(Mass Text Replacer)

As a Linux geek, I use:

find members/ -name '*.html' -print -exec perl -i.bak -p -e "s@members"@members/"@ig" {} \;
Adjusted of course for whatever site I'm working on.

Radiate 03-28-2005 11:17 AM

tis good info many peeps don't know this

emthree 03-29-2005 02:20 PM

Quote:

Originally Posted by raymor
As a Linux geek, I use:

find members/ -name '*.html' -print -exec perl -i.bak -p -e "s@members"@members/"@ig" {} \;
Adjusted of course for whatever site I'm working on.

:1orglaugh :thumbsup

emthree 03-29-2005 02:53 PM

Quote:

Originally Posted by kaktuz
how bout text editor? :)
or its a tgext to replace mass PAGES?

Well, when replacing multiple files most text editors cannot do the trick.
MTR is golden when it comes to replacing multiple lines, across multiple files on Windows. The only downside is the company seems to be undermanaged. :Oh crap

Luc 03-29-2005 03:51 PM

what is a file?


All times are GMT -7. The time now is 10:56 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123