I couldn't think of a good title for this, it's hard to explain.
Basically, I have mod_rewrite setup on my server. It turns each ?a=1&b=2&c=3 etc into /1/2/3/
I want to implement a feature where I can do something like this: /login/?return_url=/home/
The return_url would change depending on where the user was last. I know there are other methods of finding out the return url, but I would like to keep it in the URL.
My issue is that the following does not work: /login/?return_url=/home/
However, /login.php?return_url=/home/
does work.
Why can't PHP see the return_url
variable in the first (preferred) situation?
Here's my current code:
RewriteRule ^(.*)/(.*)/(.*)/([A-Za-z0-9_-]+)/$ /?a=$1&b=$2&c=$3&d=$4 [L]
RewriteRule ^(.*)/(.*)/([A-Za-z0-9_-]+)/$ /?a=$1&b=$2&c=$3 [L]
RewriteRule ^(.*)/([A-Za-z0-9_-]+)/$ /?a=$1&b=$2 [L]
RewriteRule ^([A-Za-z0-9_-]+)/$ /?a=$1 [L]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…