.htaccess statement is not redirecting..

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

  1. #1
    I wrote a regular expression for w w w.s e r v i c e s o n c l i c k . c o m / p r o d u c t s . p h p ? b r a n d i d = 2 7 & p n a m e = A c e r that redirects to h t t p : / / w w w . s e r v i c e s o n c l i c k . c o m / A c e r and
    similar to w w w . s e r v i c e s o n c l i c k . c o m / p r o d u c t s . p h p ? b r a n d i d = 2 9 & p n a m e = G i g a b y t e also redirects to h t t p : / / w w w . s e r v i c e s o n c l i c k . c o m / G i g a b y t e and so on but its not working.. I dont want to retain brandid only retain pname.

    Here it is the
    
    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]
    
    Code (markup):
    Please, I need help..
     
    abhi10kumar, Jun 16, 2011 IP
  2. mygold

    mygold Peon

    Messages:
    1,164
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try to write clearly.
     
    mygold, Jun 16, 2011 IP
  3. bownsmith

    bownsmith Peon

    Messages:
    88
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    try this code for:
    w w w.s e r v i c e s o n c l i c k . c o m / p r o d u c t s . p h p ? b r a n d i d = 2 7 & p n a m e = A c e r
    to
    h t t p : / / w w w . s e r v i c e s o n c l i c k . c o m / A c e r
    -----------------------------------------------------------------------
    --------------------------------------------
    check this code..
     
    bownsmith, Jun 16, 2011 IP
  4. abhi10kumar

    abhi10kumar Greenhorn

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    Thanks for the reply..
    It is not working
    You can also check it online

    Here is complete .htaccess file
    
    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    Options +Indexes
    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]
    
    RewriteRule /?$.php /products.php?brandid=27&pname=$1 [L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /products\.php\?brandid=27&pname=([^&]+)\ HTTP/
    RewriteRule ^products\.php$ http://www.servicesonclick.com/%1.php? [R=301,L]
    </IfModule>
    HTML:
     
    abhi10kumar, Jun 16, 2011 IP
  5. jack466453

    jack466453 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    try webconfs url rewriting tool. I hope it works
     
    jack466453, Jun 16, 2011 IP