.htaccess statement is not redirecting..

Discussion in 'Site & Server Administration' started by abhi10kumar, Jun 16, 2011.

  1. #1
    I wrote a regular expression for www . servicesonclick . com/products.php?brandid=27&pname=Acer that redirects to www . servicesonclick . com/Acer and
    similar to www . servicesonclick . com/products.php?brandid=29&pname=Gigabyte also redirects to www . servicesonclick . com/Gigabyte and so on but its not working.. I dont want to retain brandid only retain pname.

    When Redirecting I have to use brandid and pname..

    Here it is the code
    Options +FollowSymLinks
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^servicesonclick\.com$ [NC]
    RewriteRule ^(.*)$ http://www.servicesonclick.com/$1 [R=301,L]
    
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
    RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
    
    RewriteCond %{SCRIPT_FILENAME} !-d
    RewriteRule ^([^\.]+)$ products.php?brandid=27&pname=Acer [NC,L,QSA]
    PHP:
     
    abhi10kumar, Jun 16, 2011 IP