Hi
Trying to get my head around .htaccess for SEO friendly URLs.
My problem is that with each subsequent click the old URL stays more or less intact, and the new part is added to the end.
My .htaccess file looks like this:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^page/([0-9]+)/slug(.*)\.php$ page.php?pageID=$1&slug=$2 [L]
and my PHP extract looks like this:
$navpagelist.="<li><a href=\"page/".$rownavpages["pageID"]."/slug/".$rownavpages["slug"].".php\">".ucfirst($rownavpages["pagename"])."</a></li>";
So click 1 gives me:
page/1/slug/about-us.php
click2 gives me:
page/1/slug/page/1/slug/about-us.php
click3 gives me:
page/1/slug/page/1/slug/page/1/slug/about-us.php
I guess it might be a '.' or '/' too many (or too little), but I can't seem to get around it.
Can anyone help?
Many thanks