Help Me With HTAccess

Discussion in 'Site & Server Administration' started by alex06295, Aug 9, 2016.

  1. #1
    Hello,

    My .htaccess file is this

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule /(.*)$ nutrition.php?id_baseurl=$1
    RewriteRule /(.*)$ mobiles.php?baseurl=$1
    RewriteRule /(.*)$ aircon.php?id=$1


    but it is considering the last rewriterule, what is the problem?

    Thanks in advance!
     
    alex06295, Aug 9, 2016 IP
  2. WebDeveloperOne

    WebDeveloperOne Peon

    Messages:
    24
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    3
    #2
    If all those id will be the same, what happens then? You will have 3 different pages linking to one, so you lose two.
     
    WebDeveloperOne, Aug 13, 2016 IP
  3. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #3
    As the previous commentar said, you have three rules, exactly the same, which all redirect to different pages - that will, of course, not work. You will need more distinct starting points, or some other way of linking to different parts of your site.
     
    PoPSiCLe, Aug 25, 2016 IP