-
Notifications
You must be signed in to change notification settings - Fork 9
Using mod rewrite for nicer urls
Lotuscms edited this page Jul 11, 2011
·
4 revisions
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.
- 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.
- Complete.
- 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/'