N00b needs help with mod_rewrite

Discussion in 'Apache' started by adamjthompson, Sep 3, 2008.

  1. #1
    Got a little mod_rewrite problem that I can't fix here. I used Nintendo's sticky to write my .htaccess file, and the rules work OK, but only whichever rule is listed first works. The second rule won't work.

    
    Options +FollowSymLinks
    RewriteEngine on
    RewriteBase /destinations/
    RewriteRule ^(.*)\.html$ destination.php?d=$1 [L]
    RewriteRule ^(.*)-(.*)\.html$ subpage.php?s=$1 [L]
    
    Code (markup):
    How do I list several rules in a htaccess file and get them all to work?
     
    adamjthompson, Sep 3, 2008 IP
  2. The Universes

    The Universes Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Put the second rule before the first rule, I believe thats it.
     
    The Universes, Sep 3, 2008 IP
  3. adamjthompson

    adamjthompson Well-Known Member

    Messages:
    1,242
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    125
    #3
    Thanks, I found the problem - that and the dashes in the variables.
     
    adamjthompson, Sep 3, 2008 IP