.htaccess help

Discussion in 'Programming' started by Trusttec, Nov 23, 2007.

  1. #1
    Currently for mod re-write I am doing this:

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/.]+)/$ index.php?1=$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/.]+)$ index.php?1=$1 [L]
    Code (markup):
    However I want to be able to add another option, for example it only works for http://mydomain.com/index.php?id=1 I want to be able to do this http://mydomain.com/index.php?id=1&cat=2, I have peiced together the following code:

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/.]+)/(.*)/$ index.php?1=$1&id=$2 [L]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/.]+)/(.*)$ index.php?1=$1&id=$2 [L]
    Code (markup):
    however it does not work any suggestions?
     
    Trusttec, Nov 23, 2007 IP