bluebyyou Posted October 31, 2009 Share Posted October 31, 2009 I have my rewrite rules working how I want them, however my links that I am dynamically creating are not for example my link is: www.website.com/article/1/1. when i click a link on that page it becomes: www.website.com/article/1/1/article/1/1 and if i click it a third time it becomes: www.website.com/article/1/1/article/1/1/article/1/1 and so on... the current path repeats it self over everytime I click it Here are my rewrite rules... RewriteEngine On RewriteRule ^article/([0-9]+)/([0-9]+)$ article.php?categoryID=$1&articleID=$2 [NC] RewriteRule ^article/([0-9]+)$ article.php?categoryID=$1 [NC,L] here is a sample of me creating a link echo "<h3><a href='../article/".$display_category['category_id']."'>".$display_category['category_title']."</a></h3>\n"; //Show Category Title also i tried using ../../ etc in front of the links, but then the more you click the the link the farther back in the directory it goes. so that didnt work either. Link to comment https://forums.phpfreaks.com/topic/179767-solved-mod_rewrite-links-problem/ Share on other sites More sharing options...
trq Posted November 1, 2009 Share Posted November 1, 2009 I don't see why you need ../ at all. Link to comment https://forums.phpfreaks.com/topic/179767-solved-mod_rewrite-links-problem/#findComment-948518 Share on other sites More sharing options...
Dragen Posted November 1, 2009 Share Posted November 1, 2009 surely just: href="/article/' . $display_category['category_id'] . '" would suffice? Link to comment https://forums.phpfreaks.com/topic/179767-solved-mod_rewrite-links-problem/#findComment-948664 Share on other sites More sharing options...
bluebyyou Posted November 1, 2009 Author Share Posted November 1, 2009 thorpe, I did not need that, it was my attempt at a solution that did not work. Dragen, that did the trick, thanks. Link to comment https://forums.phpfreaks.com/topic/179767-solved-mod_rewrite-links-problem/#findComment-948909 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.