2
I have the following rules in my file .htaccess:
RewriteRule ^first-login/([a-zA-Z0-9]+)$ ./first-login.php?userKey=$1&step=1
RewriteRule ^first-login/([a-zA-Z0-9]+)?([0-9]+)$ ./first-login.php?userKey=$1&step=2
The first one works, I use the URL http://localhost/first-login/Xmi5drXyH9ngm4 and he fills in the variables $_GET["userKey"] e $_GET["step"] with the right values.
This page is a Wizard with a few steps to the first user account configuration, at the end of each step, I redirect the user to the same page just by changing the value of the step, then I present the targeted content. URL used: http://localhost/first-login/Xmi5drXyH9ngm4?2.
The problem: even with the ?2 at the end, I’m being redirected according to the first rule, so my variable $_GET["step"] is always receiving the value 1. What’s wrong with these regular expressions? For now I’m doing the process of hiding/showing content with jQuery.