Jump to content

[SOLVED] mod_rewrite Links problem


bluebyyou

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.