benaust Posted August 22, 2011 Share Posted August 22, 2011 I have something like below, first one is to open the variables in Template Page "TPL1" and the next to open the variables in "TPL2" page. When I add the second one the whole thing fails and do not work RewriteRule TPL1/Var1/(.*)/Var2/(.*)/Var3/(.*)/Var4/(.*)/Var5/(.*)/ TPL1.php?Var1=$1&Var2=$2&Var3=$3&Var4=$4&Var5=$5 RewriteRule TPL2/Var1/(.*)/Var2/(.*)/Var3/(.*)/Var4/(.*)/Var5/(.*)/ TPL2.php?Var1=$1&Var2=$2&Var3=$3&Var4=$4&Var5=$5 Could someone point out if this is possible and or where my mistake is, Thanks Quote Link to comment https://forums.phpfreaks.com/topic/245422-rewrite-rule-issue/ Share on other sites More sharing options...
fry2010 Posted August 31, 2011 Share Posted August 31, 2011 it is because you are looking for the same url each time, so the first one will execute and the second will not. Does it give an internal server error as well? I have similair issue, look in the thread below this one or above. Quote Link to comment https://forums.phpfreaks.com/topic/245422-rewrite-rule-issue/#findComment-1263846 Share on other sites More sharing options...
benaust Posted August 31, 2011 Author Share Posted August 31, 2011 Was there a link you referring to, I cannot see the link. Quote Link to comment https://forums.phpfreaks.com/topic/245422-rewrite-rule-issue/#findComment-1263852 Share on other sites More sharing options...
fry2010 Posted August 31, 2011 Share Posted August 31, 2011 oh sry, ignore that. I didnt look at your rule properly. I am not much good with rewrite either, just thought I spotted something similair to my issue. Quote Link to comment https://forums.phpfreaks.com/topic/245422-rewrite-rule-issue/#findComment-1263992 Share on other sites More sharing options...
benaust Posted August 31, 2011 Author Share Posted August 31, 2011 Oh, no problem, thanks for trying anyway. Appreciated. If there is anyone out there I still am stuck. I have read a lot about the rewrite rules, but I really have to change a lot to adapt to them. So first like to see if I can resolve it short way. Quote Link to comment https://forums.phpfreaks.com/topic/245422-rewrite-rule-issue/#findComment-1264084 Share on other sites More sharing options...
requinix Posted August 31, 2011 Share Posted August 31, 2011 "Whole thing fails and does not work" meaning only the first works? Or you get an error message? 1. What are the actual URLs you're dealing with? 2. What's the actual mod_rewrite stuff you're trying? Quote Link to comment https://forums.phpfreaks.com/topic/245422-rewrite-rule-issue/#findComment-1264088 Share on other sites More sharing options...
benaust Posted August 31, 2011 Author Share Posted August 31, 2011 O.K let me see if I can explain little bit better. If you look at the below two rewrite rules you can see the only difference is the main page or template page "TPL1 & TPL2" they both have same amount and same variables in each rewrite rule. If I do put both of these in the htaccess none of them will work, if the first rule is there only in htaccess it is fine. RewriteRule TPL1/Var1/(.*)/Var2/(.*)/Var3/(.*)/Var4/(.*)/Var5/(.*)/ TPL1.php?Var1=$1&Var2=$2&Var3=$3&Var4=$4&Var5=$5 RewriteRule TPL2/Var1/(.*)/Var2/(.*)/Var3/(.*)/Var4/(.*)/Var5/(.*)/ TPL2.php?Var1=$1&Var2=$2&Var3=$3&Var4=$4&Var5=$5 Below is what I have in htaccess which they do work, but not when using same condition for two different template pages. It uses same TPL1 page as template, but there are different amount of variables in each. Options +FollowSymLinks RewriteEngine on #Rule 1 RewriteRule TPL1/Page/(.*)/Place/(.*)/PageTitle/(.*)/PrintThis/(.*)/ TPL1.php?Page=$1&Place=$2&PageTitle=$3&PrintThis=$4 #Rule 2 RewriteRule index/Page/(.*)/Place/(.*)/PageTitle/(.*)/PrintThis/(.*)/domain/(.*)/ TPL1.php?Page=$1&Place=$2&PageTitle=$3&PrintThis=$4&domain=$5 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/245422-rewrite-rule-issue/#findComment-1264095 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.