I`ve been looking at some duplicate content on google that should have been redirected. I was also curious about why sub-categories always send a redirect for the parent before the correct one. This lead me to the check_direct function in seo_class.php and I'm amazed that it works at all.There are simple mistakes like: $path = substr(string, start, end) instead of $path = substr(string, start, length); and substr_replace(string,newstring, start, strlen(start)) instead of substr_replace(string,newstring, start, strlen(oldstring)) This is what I ended up with, but it needs tidying up and more thorough testing. I havent tried the category_id=0 section.