1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

mod_rewrite... links like category/?page=2

Discussion in 'Apache' started by al2six, May 23, 2005.

  1. #1
    Here's an example of the rewrite commands i have in my htacess:

    RewriteRule ^(.*)/$ category.php?cat1=$1 [L]
    RewriteRule ^(.*)$ category.php?cat1=$1 [L]

    But sometimes the category has more than one page. I've seen people with urls like "domain.com/category" for the 1st page and "domain.com/category/?page=2" for the second page. How can I do that?

    Thanks
     
    al2six, May 23, 2005 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    You don't want '?page='. You want a static URL instead of a URL defeating the reason for mod_rewrite in the first place.

    RewriteRule ^(.*)/page_(.*)/$ category.php?cat1=$1&page=$2 [L]

    If it doesn't work, post the URL of page 2,3,4...
     
    Nintendo, May 23, 2005 IP
  3. al2six

    al2six Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    thanks for the advice
     
    al2six, May 23, 2005 IP