I have a website with about a 100 pages for which the sample .htaccess file has
RewriteRule ^1/?$ page1.php [NC,L]
RewriteRule ^2/?$ page2.php [NC,L]
RewriteRule ^3/?$ page3.php [NC,L]
The problem is these pages get a lot of redirection between one another and while adding
header("location: page1.php");
works, I wish to populate this using MySQL.
I can instead hard code is to
header("location: /1");
but if one of the entries in the .htaccess file changes, I have to change in many places.
So my question is can this be controlled by MySQL, like if I have a simple table of
(id,page) values (1,page1.php)
and .htaccess gets populated based on this MySQL table.
What would be the best way to achieve this, if its possible.
Thanks.