Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Using mod rewrite for nicer urls
This method will allow you to access pages through virtual folders. eg. '/index.php?page=contact' could be access through '/page/contact/'.
- PHP 5
- Mod_rewrite PHP module must be installed and activated.
How to: Steps
- Create a file in the root folder of the CMS called '.htaccess' without the quotes.
- Paste the following into the file named '.htaccess'
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^page/(.+)/?$ index.php?page=$1 [L] RewriteRule ^page/(.+)?$ index.php?page=$1 [L] </IfModule>
- Save this file.
- You May want to update your menu links in order to reflect these new access routes. ie. edit a link, set type of external and set external link to '/page/PAGE_NAME/'