tags:

views:

18

answers:

2

Right now im sending my errors to my script using the following

Say my error is an invalid username, i redirect to domain.com/error/username

RewriteRule ^error/(.+)$/ index.php?switch=error&errortype=$1 [L]

but say i wanted to also pass the erroneous value as well, i tried the below, but it looks like its not the correct way. Redirect to: domain.com/error/username/thisisnotauser

RewriteRule ^error/(.+)$/(.+)$/ index.php?switch=error&errortype=$1&errorid=$2 [L]
A: 

Your rule is probably right, but the order of the rules in your .htaccess files is really important.

They should be in this order...

RewriteRule ^error/(.+)$/(.+)$/ index.php?switch=error&errortype=$1&errorid=$2 [L]
RewriteRule ^error/(.+)$/ index.php?switch=error&errortype=$1 [L]
Sohnee
A: 

Your regex has a $ before the end of the URI, and the second has two $.

Also as @Sohnee mentioned, you'll probably want to reverse the order.

mway