I’ve built a test project on Codeigniter on my mac (using MAMP), and am now trying to migrate it to my Linux machine (ubuntu, LAMP), to do some tesing.
Apparently, it doesn’t read the .htaccess file, since the URLs don’t work (get 404) if the index.php bit is missing (on the mac it worked just fine). Should the syntax of the .htaccess file be different on LAMP and on MAMP?
This is the syntax I’m using now:
RewriteEngine On
RewriteCond $1 !^(index\.php|robots\.txt|favicon\.ico|uploads|media|myResources)
RewriteRule ^(.*)$ index.php?/$1 [L]
I’ve read somewhere that you should restart the server after editing .htaccess. Problem is, I don’t know how to do it on the Linux machine.
Your
.htaccessrules are ignored because of AllowOverride settings. You probably want to setThis settings belongs to
httpd.conforapache.confand yes, you need to restart the apache server for this change to take effect. Later you can modify.htaccessw/o server restart.Example configuration (part of my template for new virtual host):