I am trying to get Apache to redirect /a.php?a=123 to / b / 123 (where 123 can be any number from 1 to 9999) but cannot make it work.
This is what I have in htaccess:
RewriteEngine on
RewriteRule ^a.php?a=([0-9]+) /b/$1 [L]
RewriteRule ^a.php$ /c/ [L]
In this case, the transition to a.php? a = 123 leads to 404, but switching to just a.php works as expected. Did I try to run away? (RewriteRule ^ a.php \? A = ([0-9] +) / b / $ 1 [L]), but it still doesn't work.
What am I doing wrong?
source
share