Welcome Guest, Not a member yet? Register   Sign In
CI 3 - Not working on prod server


I have been developing a web app using XAMPP on a windows computer. Everything works fine. I just set it up on the web server (ubuntu 14.04). When I go to the main URL, everything works OK. When I try to go to an page, I get a 404 error.

I have a .htaccess file (remember, it works in development).

I checked and my controller file has an uppercase first letter.

The method definitely exists because it works in production.

I enabled mod_rewrite for the .htaccess and have confirmed that it is running with Webmin ("rewrite" is checked and marked as enabled).

Here's my .htaccess with comments removed:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
php_value post_max_size 30M
php_value upload_max_filesize 30M

Any ideas? No idea why I am getting a 404 error...

Does the server allow use of .htaccess files (via the AllowOverride setting)?
If you have access to the server's config files, have you tried putting your mod_rewrite commands there?
Is your <IfModule> section inside a <Directory> section? (If not, you probably need to remove RewriteBase and you may need to change the -f and -d lines to %{DOCUMENT_ROOT}%{REQUEST_FILENAME} )

Theme © iAndrew 2016 - Forum software by © MyBB