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
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
Second portion of RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Code (markup): is redundant.