There is something strange going on lately.
The following htaccess redirect / url rewriting code worked perfectly fine for a month. But started giving error code 500 today.
I asked my hosting provider he said that he migrated all the code to a new server. I don’t understand why its not working now. The same code worked fine for almost a month.
What i want to achieve :
www.example.com/22 ---should go to--> www.example.com/view.php?iid=22
Code :
RewriteEngine on
RewriteRule ^([0-9]+) view.php?iid=$1 [NC, L]
PHP version : 7.2
2
Answers
I don't know how but the issue got fixed by removing NC from [NC, L]
New code looks like this :
Replace your rule with this:
That is:
Use anchor
$
to match only digits in URI and no spaces in side the flags[...]