Fancy URLs - adampatterson/Dingo-Framework GitHub Wiki
What Do They Do?
If your web host supports Mod_Rewrite, you have the option of enabling Fancy URLs in Dingo. Fancy URLs make it so you can access your websites pages at a URL like http://yoursite.com/controller/function/arg1/arg2
instead of http://yoursite.com/index.php/controller/function/arg1/arg2
. Essentially, Fancy URLs allows you to remove the index.php portion from the URL.
Enable It
Open up application/config/development/config.php
and find the two lines towards the top of the file that look like this:
// Does Application Use Mod_Rewrite URLs?
define("MOD_REWRITE",FALSE);
Change MOD_REWITE
to TRUE
.
The .htaccess
Next you have to create a file called .htaccess
(no file name, just the .htaccess extension) in the same folder that your index.php is in. Put the following in it:
RewriteEngine on
RewriteCond $1 !^(index\.php|img|bin)
RewriteRule ^(.*)$ index.php?__dingo_page=$1 [L]
The above htaccess code basically tells your server to transparently (you can't see it) add the index.php portion onto the beginning of the URL, unless you are requesting index.php
or something in the images folder.