Glen Swinfield’s Website v2.0

“I work for Erskine Design in Nottingham. Which is nice. You've got choices, you can visit my homepage, take a look at the available downloads or view the blog archives. Please contact me whenever you like. Also, why not subscribe to the RSS feed.”

CodeIgniter htaccess

When I transferred this site over from Wordpress I lost a load of codeigniter content, It was probably the most searched for stuff - unfortunately I don’t really remember what a lot of it was, I do remember there was a short .htaccess/remove index.php tutorial so I thought I would post something quickly for people who follow old links etc.

.htaccess file

This is a .htaccess file that rewrites all requests through index.php unless the requested url actually exists. You couldreplace /index.php with any filename (dispatch.php, router.php) whatever. Put the file in your CI document root. mod_rewrite must be enable in your httpd.conf file for this to work. Search for ‘mod_rewrite’ in your httpd.conf file and remove the comment ‘#’. A lot of shared hosts have this enabled by default.

If you are developing on http://localhost/mysites/cool_new_site/index.php make sure you set the redirection (line 4) in the .htaccess file to ‘/mysites/cool_new_site/index.php’ or you will get a 500 server error.

Get the htaccess file

Name:

Email:

URL:

Remember my personal information

Notify me of follow-up comments?

CodeIgniter

Other Posts