We are building a PHP site with CMS, and would like to give the users the ability to dynamically create new pages just like WordPress does.
All the pages will have the same format - but we just need to know if it's possible to define htaccess in a way that any site address always resolves to our single template. The idea is that no matter what address the user typed in their browser, it would resolve to our template page and our template page could determine which page was being requested and read the database for that content.
1) User enters in http://mydomain.com/contactus in their browser
2) Our htaccess file redirects the request to http://mydomain.com/index.php
3) Our index.php file reads the address (http://mydomain.com/contactus) and then fetches content from the database with the key: contactus and displays the page.
Is this a reasonable approach? If so, how could the htaccess file be configured?
If not, is there a reasonably straightforward way to accomplish this?
Many thanks experts!