PDA

View Full Version : 404 Not Found from filter addon



Petrache Nicolae
December 5, 2012, 10:36 AM
Google crowlers posts several errors and this is one of them http://www.piese-laptop.ro/ro/ex.php?page=en&rlVareables=laptopuri-tablete/hunedoara/memorie-ram:5/ . from what i can see it is based on the filters addon and if i check manualy via the filter box, the link will be http://www.piese-laptop.ro/laptopuri-tablete/hunedoara/memorie-ram:5/ . this applies in many other case so why the diference?

John
December 7, 2012, 05:56 AM
Hi Patrice,
To be honest I don't know where google gets such link with domain.com/index.php, your website uses apache mod_rewrite and all links
on the website have html extension, but google found link like this somewhere: domain.com/index.php?blablabla and use it.
Anyway I can share simple fix for this issue:

1. open index.php line ~170
2. find the code:


if ( $rlNavigator -> cMobile )
{
$currentPage = ltrim(ltrim($currentPage, $config['mobile_location_name']), '/');
}

if ( $config['lang'] != $rlNavigator -> cLang )
{
if ( defined('RL_MOBILE') && RL_MOBILE && $config['mobile_location_type'] == 'subdirectory' && isset($_GET['wildcard']) )
{
$currentPage = ltrim($currentPage, $config['mobile_location_name']);
}

$currentPage = substr($currentPage, 3, strlen($currentPage));
$currentPage = !(bool)preg_match('/\.html$/', $currentPage) && $currentPage ? $currentPage .'/' : $currentPage;
}
elseif ( strlen($currentPage) == 2 )
{
$currentPage = '';
}
else
{
$currentPage = !(bool)preg_match('/\.html$/', $currentPage) && $currentPage ? $currentPage .'/' : $currentPage;
}


3. replace with this code:


if ( !is_numeric(strpos($currentPage, 'index.php')) )
{
if ( $rlNavigator -> cMobile )
{
$currentPage = ltrim(ltrim($currentPage, $config['mobile_location_name']), '/');
}

if ( $config['lang'] != $rlNavigator -> cLang )
{
if ( defined('RL_MOBILE') && RL_MOBILE && $config['mobile_location_type'] == 'subdirectory' && isset($_GET['wildcard']) )
{
$currentPage = ltrim($currentPage, $config['mobile_location_name']);
}

$currentPage = substr($currentPage, 3, strlen($currentPage));
$currentPage = !(bool)preg_match('/\.html$/', $currentPage) && $currentPage ? $currentPage .'/' : $currentPage;
}
elseif ( strlen($currentPage) == 2 )
{
$currentPage = '';
}
else
{
$currentPage = !(bool)preg_match('/\.html$/', $currentPage) && $currentPage ? $currentPage .'/' : $currentPage;
}
}


John

Petrache Nicolae
December 7, 2012, 06:27 AM
ok. have made the replacement and now will see if more errors will come