But getting CodeIgniter to do clean URLs was a faff. Out of the box with CodeIgniter you get this….
…when instead you want this:
The trick is down to some .htaccess faffing. (Sysadmins will balk at this, because the right place to fix this is in httpd.conf, but with Dreamhost we don’t have that level of access). Your .htaccess file should look something like this:
Note the ? after the index.php.
I also add this at the top to enable compression of the content being transmitted:
In my config.php file I also had to change my uri_protocol parameter, like this:
…and then we’re done – clean URLs in CodeIgniter on Dreamhost.
]]>Check the root of your Mac hard disk – there should be a .htaccess file lurking there, with contents that include…
Delete this file, or rename it if you’re not happy about doing that. Go to your MAMP start page and everything should be OK again. Time for a celebratory cup of tea.
Update 16th Feb: Ben Frain notes that you might not see the .htaccess in your root folder because it’s a hidden file – his blog post details the Terminal command you need to show all files.
]]>