Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2007
    Location
    Lebanon
    Posts
    413
    .htaccess problem

    Hello I have a problem with my .htaccess file
    I have a page xxx.php that takes a variable var1 in my htaccess I am doing rewrite rules to rewrite the name of this page.
    Now what is happening is that if I have
    test.html -> xxx.php?var1=1
    xxx_test.html -> xxx.php?var1=2
    now test.html is leading to xxx.php?var1=1 but xxx_test.html at the place of going to xxx.php?var1=2 it's also going to xxx.php?var1=1
    it's like htaccess is just reading the "test.html" part of the link
    Thanks in advance for any help





    __________________Hicham MallahWeb Developer

  2. #2
    Join Date
    Oct 2002
    Location
    /roof/ledge
    Posts
    28,088
    Show the rewrite code please.





    __________________Did you know WHT has a help desk?
    Have a forum? Let's face it, you need help.

  3. #3
    Join Date
    Dec 2007
    Location
    Lebanon
    Posts
    413
    RewriteRule test\.html$ test.php?var1=5

  4. #4
    Join Date
    Oct 2002
    Location
    /roof/ledge
    Posts
    28,088
    Try adding the "starts with" bit to the rule:
    RewriteRule ^test\.html$ test.php?var1=5

  5. #5
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,849
    Yep, or in this case you could just reverse the order of the rules, so you look for tech_test.html first.





    __________________
    Chris <ClonePanel>
    "Not everything that can be counted counts, and not everything that counts can be counted" - Albert Einstein

  6. #6
    Join Date
    Dec 2007
    Location
    Lebanon
    Posts
    413
    missed that! worked thanks a lot both





    __________________Hicham MallahWeb Developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •