dynamic url to static url

Discussion in 'Apache' started by joe_mat, Oct 27, 2007.

  1. #1
    Hello,

    I wanna make all dynamic links on my website to static url.

    Like i have done with category.

    RewriteRule ^category/([0-9]+).*$ index.php?mod=products&cat=$1 [L].

    But i am having problem, to make static url for page result.

    Like if someone click on particular category it will show only 20 records per page and if that category having more then 20 records then it will create page number below.

    so i want if someone clicks on that particular page number then user will see static page.

    I have tried :
    RewriteRule ^partners/([0-9]+)/([0-9A-Za-z]+).html partners/affiliate_links.php?catid=$1&sp=$2&np=$3 [L]

    but its giving error.

    Please suggest how to solve this.

    Thanks
     
    joe_mat, Oct 27, 2007 IP
  2. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The problem is that the .* in the first rule matches anything that would trigger the second rule.

    I would remove the .* altogether or replace it with something more specific to the URLs you actually use.

    You could also move the second rule above the first rule so that it matches first.
     
    Ladadadada, Oct 29, 2007 IP
  3. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Actually, on closer inspection, you might be getting the error in the second rule because you reference $1, $2 and $3 in the second part but you only have 2 (.+) blocks in the first part of the rule.

    Either add another block in parentheses or drop the $3 from the rule.
     
    Ladadadada, Oct 29, 2007 IP