Jump to content

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/245422-rewrite-rule-issue/
Share on other sites

  • 2 weeks later...

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

Link to comment
https://forums.phpfreaks.com/topic/245422-rewrite-rule-issue/#findComment-1264095
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.