I've read the charter and combed through the stuff at apache.org, but haven't been able to figure out how to accomplish the following, or even tell if it's possible. Any help is appreciated -
I have a database-driven website consisting of a template.php page and an index.php page. The navigation for the site is pulled from the database and pages are created on-the-fly once requested.
The way this works is, the index page populates with nav items (drawn from MySQL) - when you click on a nav item the new page pulls the appropriate content and populates the template.php page. I'm using mod rewrite to convert the name of the template.php page to /nav-name/index.php
This is the line I do this with:
RewriteRule ^(.*)/index.php(.*)$ /template.php?page=$1
So with 10-pages of content in the SQL table, there's an index page in the root folder, and 9 more sub-folders with index pages of their own, which are really just mod-rewritten template.php pages.
What I'd LIKE to do is, instead of generating the pages in a folder (/nav-name/index.php) I'd like to keep them in the root folder - www.example.com/nav-name.php and still be able to populate the template page with the appropriate content.
Is this possible to do using mod rewrite, and if so - how?