currently I use a CMS that I've written myself. Basically, it just stores all data in a MySQL database and pulls the data from it using a simple PHP script. Now, the script looks messy depending on which page I wish to get from the database, for example:
index.php?lang=eng&page0=this&page1=that ....
Currently I use mod_rewrite to do this:
- Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/site/(.*)
RewriteRule ^(.*) /index.php?lang=%1
RewriteCond %{REQUEST_URI} ^/site/(.*)/(.*)
RewriteRule ^(.*) /index.php?lang=%1&page0=%2
RewriteCond %{REQUEST_URI} ^/site/(.*)/(.*)/(.*)
RewriteRule ^(.*) /index.php?lang=%1&page0=%2&page1=%3
Just wondering if there's a better way to do this? Maybe something instead of having all these rewrite conditions, depending on the depth of the hierarchy.