PDA

View Full Version : Mod-rewrite = spidering / URL problems


jcnorris
10-25-2006, 10:46 AM
Hello,

Couldn't quite get to the bottom of this via a search, but it seems that others have been there ...

Our rewrite rule renders .../index.php?section=4 to .../r-section-4

Spidering is getting confused and not getting into sub-pages, and search results often include a trailing slash (e.g., ".../r-section-4/").

The good news is that all of our rewritten url's begin with "r-", so I should be able to capture these, were I clever! The bad news is that I ain't that clever.

Would be happy to be pointed to an applicable thread, etc.

Thanks!

Charter
10-26-2006, 09:38 AM
Untested but find in the phpdigRewriteUrl function:

// phpdig 1.8.9 rc1

$retour['path'] = mb_ereg_replace('(.*[^/])/?$','\1/',mb_ereg_replace('^/(.*)','\1',mb_ereg_replace("/+","/",$path)));

// phpdig 1.8.8

$retour['path'] = ereg_replace('(.*[^/])/?$','\1/',ereg_replace('^/(.*)','\1',ereg_replace("/+","/",$path)));


And replace with the following:

// phpdig 1.8.9 rc1

$retour['path'] = mb_ereg_replace('^/(.*)','\1',mb_ereg_replace("/+","/",$path));

// phpdig 1.8.8

$retour['path'] = ereg_replace('^/(.*)','\1',ereg_replace("/+","/",$path));