Results 1 to 6 of 6
Thread: .htaccess problem
-
12-11-2008, 06:57 AM #1Aspiring Evangelist
- 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
-
12-11-2008, 07:09 AM #2
Show the rewrite code please.
__________________Did you know WHT has a help desk?
Have a forum? Let's face it, you need help.
-
12-11-2008, 07:13 AM #3Aspiring Evangelist
- Join Date
- Dec 2007
- Location
- Lebanon
- Posts
- 413
RewriteRule test\.html$ test.php?var1=5
-
12-11-2008, 07:39 AM #4
Try adding the "starts with" bit to the rule:
RewriteRule ^test\.html$ test.php?var1=5
-
12-11-2008, 07:42 AM #5Retired Moderator
- 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
-
12-11-2008, 08:54 AM #6Aspiring Evangelist
- Join Date
- Dec 2007
- Location
- Lebanon
- Posts
- 413
missed that! worked thanks a lot both
__________________Hicham MallahWeb Developer