I am using FTP to upload a codeigniter website to a server. I have arranged the files in FTP as following (I don't have 10 in reputition):
The index.php finds the system and application folder. But I don't know what to do with the .htaccess file. I have tried various examples from the web and here's an example:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteCond %{REQUEST_URI} !^/public_html/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /public_html/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ public_html/index.php [L]
This is the first time I use codeigniter and this question is probably stupid (sorry). I'm really thankful for all the help I can get.
I have another .htaccess file now which removes index.php from url:
RewriteEngine On
RewriteBase /example.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
If you want to remove index.php
from urls then please use following code in .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Copied from revision 3 of the question
So the problem wasn't the .htaccess! I fixed it by making my controllers first letter a capital letter.