CodeIgniter Forums

Full Version: Clean URLs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I was having some issues with clean urls, but came up with a solution and thought I'd share it. First make a 2nd .htaccess outside of the application directory in the web root directory. Then make the edits here:

NOTICE: Make sure you leave the original .htaccess file alone that is in your application directory. Failing to do so will expose your helpers, controllers, etc.

You also want to make sure you enabled mod rewrite in your httpd.conf apache configuration file as well as change line 29ish in config.php to read:

$config['index_page'] = '';

El Forum

You just opened up a large security hole. You should NOT remove the htaccess protecting the /application directory as you stated. If you do, people will have direct access to your libraries, models, views, controllers, helpers, config settings and anything else, which they shouldn't have access to. See the user guide for how to do this properly.

All you should do is create a NEW htaccess like you mentioned in the root directory and leave the default htaccess files protecting the /application and /system directories alone! Please fix your guide before you steer people in the WRONG direction.

El Forum

Well, this is for local development only, but I see your point. I was more focused on getting things working right and forgot that the original .htaccess file says Deny from all on the first line. I'll make sure I fix that, but thankfully there is no guide just what I've posted on here so far so that's a bonus. I'll edit my post. Thanks.