Index: trunk/core/units/general/helpers/mod_rewrite_helper.php =================================================================== diff -u -N -r4792 -r4806 --- trunk/core/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 4792) +++ trunk/core/units/general/helpers/mod_rewrite_helper.php (.../mod_rewrite_helper.php) (revision 4806) @@ -93,12 +93,19 @@ $this->HTTPQuery->Set('m_cat_page', $rets[2]); } - $sql = 'SELECT CategoryId - FROM '.TABLE_PREFIX.'Category - WHERE NamedParentPath = '.$this->Conn->qstr($category_path); - array_push($category_stack, $this->Conn->GetOne($sql) ); + if ($category_path == '') { + // this is "Home" virtual category + array_push($category_stack, 0); + } + else { + $sql = 'SELECT CategoryId + FROM '.TABLE_PREFIX.'Category + WHERE NamedParentPath = '.$this->Conn->qstr($category_path); + array_push($category_stack, $this->Conn->GetOne($sql) ); + } + $category_found = end($category_stack); - if($category_found) $url_part = array_shift($url_parts); + if ($category_found !== false) $url_part = array_shift($url_parts); }while ($category_found && $url_part); @@ -108,7 +115,7 @@ { $category_id = array_pop($category_stack); } - if($category_id) + if($category_id !== false) { $this->HTTPQuery->Set('m_cat_id', $category_id); }