Rewrite rule to control entire site?
Posted: Mon Mar 24, 2008 9:29 am
I am currently working on a website project, and the page data for every page is stored in a database (HTML markup, etc). Then, when the user goes to 'www.something.tld/somepage.php' a query is executed that looks in the database for the page that has the field requri that matches '/somepage.php' and then displays the contents from the database. Same goes for if they go to 'www.something.tld/Somedepartment/someDeptPage.php', a query is executed that takes the request URI '/Somedepartment/someDeptPage.php' and finds the matching requri in the database then displays the content. That entire part works great, however....
I was wondering if it was possible (using rewrite rules) to just have a SINGLE php page (ie index.php) but make it appear the structure of department folders and pages still exists? So if a user goes to http://www.something.tld/Somedepartment ... ptPage.php for example, it would really just display the /index.php file but use the URI /Somedepartment/someDeptPage.php so it looks like the structure is there, however all of the files are not required.
I thought about just doing query strings in the URL (like ?page=___________) but that change is too drastic for the current site, as the structure of the URL's cant change.
I was wondering if it was possible (using rewrite rules) to just have a SINGLE php page (ie index.php) but make it appear the structure of department folders and pages still exists? So if a user goes to http://www.something.tld/Somedepartment ... ptPage.php for example, it would really just display the /index.php file but use the URI /Somedepartment/someDeptPage.php so it looks like the structure is there, however all of the files are not required.
I thought about just doing query strings in the URL (like ?page=___________) but that change is too drastic for the current site, as the structure of the URL's cant change.