Mod Rewrite Help Please!!

Discussion in 'Apache' started by DarylR, Oct 25, 2009.

  1. #1
    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ $1/
    RewriteRule ^([^/]+)/$ index.php?SOMETHING=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?SOMETHING1=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?SOMETHING2=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?SOMETHING3=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?SOMETHING4=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?premium=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?about=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?tutorials=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?faq=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?contact=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?user=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?terms=$1 [NC,L]
    RewriteRule ^([^/]+)/$ index.php?downloads=$1 [NC,L]

    That's what I have so far..

    Except the Downloads needs to be different, since I want it to be /download/$1

    But it's not working so if I could get help that would be great, thanks.
     
    Last edited: Oct 25, 2009
    DarylR, Oct 25, 2009 IP
  2. chadsmith

    chadsmith Peon

    Messages:
    82
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    All those rules are the same, so they are sending everything to the first rule and then stopping. If you want to rewrite the downloads you can add

    RewriteRule ^download/([^/]+)/$ index.php?downloads=$1 [L]
    Code (markup):
     
    chadsmith, Oct 26, 2009 IP