You get a bonus - 1 coin for daily activity. Now you have 1 coin

Double slash or empty character doesn't work in RewriteRule

Practice




double slash or empty character doesn't work in RewriteRule
this works
RewriteRule ^bill/([a-zA-Z+0-9_-]+)/([0-9]+)$ /bill.php?id=$2


doesn't work if there's no first group
that is, links like

http://site/bill//101919

I tried
RewriteRule ^bill/([a-zA-Z+0-9_-]*)/([0-9]+)$ /bill.php?id=$2
RewriteRule ^bill//([0-9]+)$ /bill.php?id=$1


doesn't work

as I understand it, Apache merges a double or multiple slash into one
so just try


RewriteRule ^bill/([0-9]+)$ /bill.php?id=$1

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)