.htaccess rewrite rule

Discussion in 'Programming' started by izlik, May 5, 2010.

  1. #1
    Hello

    i was wondering if someone could be so kind as to show me how i could rewrite my domain with .htaccess. i would like http://mydomain.com/cars/ to go to cars.php, how could i do this ?
     
    izlik, May 5, 2010 IP
  2. izlik

    izlik Well-Known Member

    Messages:
    2,399
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    185
    #2
    i got it to work with the following "RewriteRule ^cars/$ /cars.php" however i still have one question. how can i do it so it do not cares about if "cars" is typed with upper or lowercase ?
     
    izlik, May 6, 2010 IP
  3. arpx

    arpx Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    write NC in the end
     
    arpx, May 7, 2010 IP
  4. alexemilov

    alexemilov Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Well "Options +Multiviews" in .htaccess then 'asd.php' = 'asd' , cars.php = cars
     
    alexemilov, May 8, 2010 IP
  5. bprashanth.gi

    bprashanth.gi Active Member

    Messages:
    55
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    93
    #5
    RewriteRule ^cars/$ /cars.php [NC]
    This should do it...
     
    bprashanth.gi, May 8, 2010 IP