HTACCESS help

Discussion in 'Programming' started by Marty Rogers, Apr 24, 2007.

  1. #1
    RewriteRule ^layouts-gallery/(.*)$ layouts-gallery.php?myid=$1
    RewriteRule ^layouts-gallery/(.*)/(.*)$ layouts-gallery.php?myid=$1$page=$2
    Code (markup):
    The parts above are what im using in my .htaccess file to try and make my users layout gallery's more search engine friendly. The first one works (changes layouts-gallery.php?myid=1 to layouts-gallery/1) but now i need pages to work, check this page out:

    http://www.myrawr.com/layouts-gallery/1

    That is my gallery of layouts, try clicking page 2 - the page works but still shows the layouts from page one... anybody know what i need to do to change this so that it works correctly? Pages work like this:

    http://www.myrawr.com/layouts-gallery/1/2 (page 2)

    Well, that's how i want them to work anyway...

    Thanks for any help in advance!
     
    Marty Rogers, Apr 24, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    You forgot an & sing. However, you can do this with one line:

    Try:
    
    RewriteRule ^layouts-gallery/(.*)(/\d+)?$ layouts-gallery.php?myid=$1&$page=$2
    
    Code (markup):
     
    nico_swd, Apr 24, 2007 IP
  3. Marty Rogers

    Marty Rogers Guest

    Messages:
    596
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks nico, but that didn't seem to work - still displayed the same layouts from page one. Page two should have only 2 layouts on :(
     
    Marty Rogers, Apr 24, 2007 IP
  4. rodney88

    rodney88 Guest

    Messages:
    480
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #4
    RewriteRule ^layouts-gallery/([0-9]+)/?([0-9]+)?$ layouts-gallery.php?myid=$1&page=$2
     
    rodney88, Apr 24, 2007 IP
  5. Marty Rogers

    Marty Rogers Guest

    Messages:
    596
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thankyou :)
     
    Marty Rogers, Apr 24, 2007 IP