Forum Moderators: coopster

Message Too Old, No Replies

PHP Multiplying Links!

Strange goings on with link count

         

RobOgden

8:03 pm on Oct 4, 2004 (gmt 0)

10+ Year Member



My site was running extremely slowly and I used a link testing program to check for broken links on my homepage. After it had counted 5000 and was still going (my homepage is only 200 lines of code), I had to stop it. It was returning links such as www.***.com/index.php/stylesheets/stylesheets/stylesheets/style1.css
There is no such directory!
The same happens with javascript: I call these and the stylesheets remotely.
It appears there is some loop slowing down my site. All my headers and footers etc. are included using include_once(....) and there is only one link to my stylesheet in the header.inc, so I cannot understand it.

I would be very grateful for any advice or help.
Yours,
Rob

ergophobe

8:57 pm on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



How are you building your links?

Are you somehow getting the directory in there twice? Then if you are building the links based on REQUEST_URI or REFERER or something like that, the dir gets added in every go 'round and you have an infinite loop. If you're using rewriting, you might even be able to resolve those links and then it would never stop.

I can't see why that would slow you down for mormal pages, though, unless there's some sort of auto-generated site map.

Tom

RobOgden

9:35 pm on Oct 4, 2004 (gmt 0)

10+ Year Member



Thanks Tom,
It seems fine when I select all the generated html and run that throught the link sleuth program, but when it searches through the php, it seems as though it's in a loop. The software treats images and even javascript and stylesheet links as normal links, but perhaps it is just not configured for searching through PHP scripts. It may be counting all <h1> tags etc. as links to the stylesheet or something.
My links are configured normally, but I am using a DHTML drop down menu bar which may affect things.
Headers, footers etc. are called with include_once() and are inc files.
Anyway, sorry it's a bit vague, but I feel better that the dynamically-generated code is testing ok.
Yours,
Rob