Remember those long and ugly URLs that show up sometime when you click on a link – like
http://yourfamousdomain.com/index.php?page=new_products
The URL shows the question mark and all the code that has to follow, especially when you may have multiple layers or very long page names. That can be solved by turning on “mod_rewrite” in config.php in your CMSMS root directory. It also involves copying the htaccess.txt file from the CMS “doc” folder to the CMS root directory. Using “pretty URLs” will leave this in your browser location bar…
http://www.yourfamousdomain.com/new_products/
Let’s begin by opening “config.php” and making our changes. In the “URL Settings” section, find the following line
$config['url_rewriting'] = 'none';
and change “none” to “mod_rewrite”
Then where $config['page_extension'] = '/'; is, change the '' to '/'. This will add a forward slash at the end of your URL. Save and close your editor.
Now, copy /Doc/htaccess.txt to your root directory and rename the file “.htaccess” Note the DOT before htaccess. It has to be that way for Apache to find it. It is no longer htaccess.txt! In .htaccess, make sure that if you have installed CMS in a subdirectory, to find
RewriteBase /
and change the / to something like this:
RewriteBase /mycmsdirectory
Do not follow the directory name with a forward slash – leave it open!
Make sure that in your Apache “httpd-vhosts.conf” that the entry for your DocumentRoot looks like this:
<Directory "/users/myfabulousdomain/htdocs">
Options FollowSymLinks
AllowOverride All
Order deny,allow
allow from all
Satisfy all
</Directory>
the “FollowSymLinks” is very important for “Pretty URLs”, as is “allow from all”