
Getting your CodeIgniter .htaccess mod rewrite to work on Network Solutions
20 August 2010, 02:22You would've thought, given the big reputation of the popular hosting server, Network Solutions, you wouldn't run into any problems implementing something as basic as a modrewrite in a .htaccess. Hell we do that on our cheapo local host without a single problem all the time!
But lo and behold, it is true, Network Solutions do not implement .htaccess very well, for some reason. Which is silly, because nearly every other CMS/Blog solution out there these days utilize modrewrite for SEO friendly URLs. Thankfully, the problem is not without a solution.
We use the CodeIgniter PHP framework, this is our solution for getting the modrewrite to 'remove' the index.php from your URLs, using .htaccess, on a Network Solutions unix host.
Tip #1
If your .htaccess contains <ifmodule mod_rewrite.c=""> </ifmodule>, remove them. Just do it.
Tip #2
This the exact .htaccess that worked for our CodeIgniter installation.
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
Something to take note of is the trailing slash infront of index.php, as well as the ? behind it. Again, don't ask why, just do it. :)
That should do the trick.
« Back
Comments