htaccess question

Discussion in 'PHP' started by xenyo, Apr 3, 2007.

  1. #1
    I must admit that I am not very good at coding and therefore wanted to ask for some assitance for one of my personal sites.

    I have made an htaccess file to handle a load of redirects in my attempt to get some SEOed URLs.

    Could someone give me a few pointers on whether this looks right?

    RewriteEngine On
    
    RewriteRule ^gifts/(.*)$ shop.php?tag=$1 [QSA,L]
    
    RewriteRule ^shop/(.*).html$ shop_list.php?item=$1 [QSA,L]
    
    RewriteRule ^shops/(.*)/(.*)$ shop_list.php?mcat=$1&scat=$2 [QSA,L]
    
    RewriteRule ^shops/(.*)$ shop_list.php?mcat=$1 [QSA,L]
    
    RewriteRule ^(.*)/(.*)/([0-9]).html$ shop.php?mcat=$1&scat=$2&pg=$3 [QSA,L]
    
    RewriteRule ^(.*)/(.*)/(.*).php$ shop.php?item=$3 [QSA,L]
    
    RewriteRule ^(.*)/(.*)/(.*).html$ shop.php?item=$3 [QSA,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/(.+).html$ shop.php?mcat=$1&pg=$2
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/(.+)$ shop.php?mcat=$1&scat=$2
    
    #RewriteRule ^(.+)$ shop.php?scat=$1 [QSA,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+).html$ shop.php?pg=$1
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)$ shop.php?mcat=$1
    
    RewriteCond %{HTTP_HOST} ^iratethis\.com 
    RewriteRule (.*) http://www.iratethis.com [R=301,L] 
    Code (markup):

    Thanks in Advance,

    Matt
     
    xenyo, Apr 3, 2007 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The only way to tell for sure is to test it.
     
    mad4, Apr 3, 2007 IP
  3. evera

    evera Peon

    Messages:
    283
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    MAd is right, only testing will do it.
    BTW this should be in the apache subforum ;)
     
    evera, Apr 3, 2007 IP
  4. xenyo

    xenyo Peon

    Messages:
    1,648
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yeah, It seems to work fine in use but unsure whether the search engines will like it or get confused.

    Apologies for wrong forum..
     
    xenyo, Apr 3, 2007 IP