Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm using apache mod_rewrite and I have the following RewriteCond and RewriteRule in my .htaccess file.I have more than 10 regular expressions in which I capture and convert to url parameters using mod_Rewrite.

RewriteCond %{REQUEST_URI} ^/([^/]*)/([^/]*)/? .....//continue for more than 10 expressions...

RewriteRule .* index.php?par1=%1&par2=%2&par3=%3 ..... par10=%10

But the problem is,for the 10th url parameter for example,the value will not match the 10th expression value but the 1st expression value with a following 0.
%10 = %1 + 0
%11 = %1 + 1
%12 = %1 + 2
.
.
But I want to have the 10th,11th,... expression values.

What should I do?I couldn't find any solution to this issue.I appreciate if anyone could help me with this issue.
Thanks in advance.

UPDATE:
I've read from the apache documentation that backreferences for both RewriteRule($N) & RewriteCond(%N) are between 0 and 9.
I found out that recursion would be useful in this case but I don't know(and couldn't find out)how.
Posted
Updated 3-Feb-15 10:33am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900