Forum Moderators: phranque
In my first rule I take the flag from the string. So "mydomain/var1/var2/~myflags/aa" becomes "mydomain/var1/var2/aa" and the flags are stored into environment variable flagz.
RewriteRule ^(.*)~([^/]+)/(.*) $1$3 [E=flagz:$2]
Next this variable is taken up in the final transformation:
RewriteRule ^([^/]*)/([^/]*)/([^/]+) $3.php?a=$1&b=$2&flags=%{ENV:flagz} [L]
It looks like "[E=flagz:$2]" doesn't work, but I don't know what is wrong.
Thanks
But it seems that the whole thing could be done in one step, avoiding input-URL ambiguity and the need to chain two rules with a [C] flag:
RewriteRule ^([^/]+)/([^/]+)/~([^/]+)/([^/]+)$ $4.php/?a=$1&b=$2 [E=flagz:$3,L]
Jim