Yet another mod_rewrite problem (500 Error)... please help ?

Discussion in 'Apache' started by poopie, Mar 7, 2008.

  1. #1
    Hello everyone,
    Please note: I am a total newbie to Apache :(

    here's my .htaccess right now, on my domain's root directory,
    which gives me an Internal Server Error:

    I know there are probably tons of things wrong here!

    What I want to achieve:
    · domain.com/something ===> domain.com/index.php?var1=something
    · domain.com/something/numbers ===> domain.com/index.php?var1=something&var2=numbers
    · ending trailing slashes optional "/" (I think it's done with: /? )
    · IGNORE the redirection if " something" is a directory or file !



    If someone could give me a hand here I'd be eternally grateful
    :)
     
    poopie, Mar 7, 2008 IP
  2. poopie

    poopie Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I finally got it .....

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/([0-9]+)/?$ index.php?var1=$1&var2=$2 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/?$ index.php?var1=$1 [L]




    thanks anyway :rolleyes:
     
    poopie, Mar 8, 2008 IP
  3. kulinar

    kulinar Member

    Messages:
    45
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    Second portion of
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    Code (markup):
    is redundant.
     
    kulinar, Mar 10, 2008 IP
  4. poopie

    poopie Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for that :)
     
    poopie, Mar 11, 2008 IP