Multiple rewrite rules within .htaccess

Discussion in 'Search Engine Optimization' started by abhi10kumar, Jun 17, 2011.

  1. #1
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /products.php?brandid=27&pname=$1 [NC]
    PHP:
    The above works only for branid=27


    And, If I include mutilple statements, LIKE
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /products.php?brandid=27&pname=$1 [NC]
    RewriteRule ^(.*)$ /products.php?brandid=42&pname=$1 [NC]
    RewriteRule ^(.*)$ /products.php?brandid=47&pname=$1 [NC]
    PHP:
    it will also run for brandid 27.


    I tried lots of stuff but wont able to rewrite rules for mutiple brandid.

    For Example:
    The url [http://www.3gphone.in/products.php?brandid=27&pname=Acer] redirects [http://www.3gphone.in/Acer]
     
    abhi10kumar, Jun 17, 2011 IP
  2. mandy111

    mandy111 Greenhorn

    Messages:
    84
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #2
    Thanks a lot for posting the coding part ,I definitely use the tool.
     
    mandy111, Jun 17, 2011 IP