Web Hosting Talk







View Full Version : .htaccess problem


Codebird
12-11-2008, 06:57 AM
.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

bear
12-11-2008, 07:09 AM
Show the rewrite code please.





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

Codebird
12-11-2008, 07:13 AM
RewriteRule test\.html$ test.php?var1=5

bear
12-11-2008, 07:39 AM
Try adding the "starts with" bit to the rule:
RewriteRule ^test\.html$ test.php?var1=5

foobic
12-11-2008, 07:42 AM
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

Codebird
12-11-2008, 08:54 AM
missed that! worked thanks a lot both





__________________Hicham MallahWeb Developer