Link to mod_rewrite urls from categories page.

Discussion in 'PHP' started by web_junkie, Jun 6, 2008.

  1. #1
    Hi, how can i best link to pages that i have rewrite on the .htaccess file from my dynamic pages, As you know dynamic links are generated from the database, so if for example, I have change the urls of all my products page how do i change each link to them from the categories page?
    Thanks
     
    web_junkie, Jun 6, 2008 IP
  2. Lordo

    Lordo Well-Known Member

    Messages:
    2,082
    Likes Received:
    58
    Best Answers:
    0
    Trophy Points:
    190
    #2
    The links should not be static or written by you to a file :) They should be driven from the database.
     
    Lordo, Jun 6, 2008 IP
  3. web_junkie

    web_junkie Active Member

    Messages:
    98
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    So should I place the new static links in the data base for each products and then pull it from there.
     
    web_junkie, Jun 6, 2008 IP
  4. mehmetm

    mehmetm Well-Known Member

    Messages:
    134
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #4
    I suggest you to create product links dynamic. So you create the navigation menu of products area as getting the product name and product id from the database.

    if you want nice looking urls, for example you can do this;

    Such a product's name is ABC and it's product id is 10. So the link for that product can be abc-10.html

    Using mod_rewrite grab product id (as 10) from the url and send it to your product detail page.

    My explanation could be some complex sorry :rolleyes:

    you can ask detail, if you need help ;)
     
    mehmetm, Jun 6, 2008 IP