Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.