I'm struggling to get a simple URL rewrite in my htaccess file to work. It looks like this:
RewriteRule ^getbars/([A-Za-z\d,]+)?$ getbars.php?guid=$1 [NC,L]
The idea is to redirect URLs such as /getbars/519f1dec603f9 to /getbars.php?guid=519f1dec603f9
For some reason, however, the guid parameter is empty when I try to get it in getbars.php
However, if I change it to
RewriteRule ^bars/([A-Za-z\d,]+)?$ getbars.php?guid=$1 [NC,L]
and load /bars/519f1dec603f9 in my browser instead, it seems to work OK.
What am I doing wrong?