Server side redirects and wrong links in the resulting page
March 19, 2007 03:31PM
I have a header(Location: ) statement in my php file. The spider picks up the redirection fine, fetches and indexes the page BUT all the relative links in the page which the spider has been are not found.

Example the page http://blah.com/foo/index.php redirects to http://blah.com/foo/bar/index.php - the spider gets the page http://blah.com/foo/bar/index.php but it still tries to find relative the links inside this page relative to http://blah.com/foo/ instead of http://blah.com/foo/bar/

P.S. Phorum is converting the http urls to links sad smiley
Re: Server side redirects and wrong links in the resulting page
March 20, 2007 01:26PM
OK found a solution....

Line 129 in file spiderfuncs.php currently reads
if (ereg("Location: *([^\n\r ]+)", $answer, $regs) && $httpcode == 3 && $full_httpcode != 302)

it should be

if (ereg("Location: *([^\n\r ]+)", $answer, $regs) && $httpcode == 3 && $full_httpcode == 302)

Notice the last == instead of !=

HTH

Tarique
Sorry, only registered users may post in this forum.

Click here to login