Internal .htaccess redirect question

Discussion in 'Apache' started by Deadsquirrel, Nov 12, 2010.

  1. #1
    Last edited: Nov 12, 2010
    Deadsquirrel, Nov 12, 2010 IP
  2. badhim

    badhim Member

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #2
    Add the following strings to the .htaccess file:
    
    RewriteEngine on
    RewriteRule ^http\:\/\/www\.example\.co\.uk\/shop\/shop\.php\?c1\=Accessories$ http\:\/\/www\.example\.co\.uk\/accessories\.htm [R=301,L]
    
    Code (markup):
    Another way is to modify the shop.php script
    
    if ($c1 = 'Accessories') {
      header('Location: http://www.example.co.uk/accessories.htm');
      exit;
    }
    
    PHP:
     
    badhim, Nov 19, 2010 IP