It's my first time i'm uploading codeigniter project to production and i'm getting error 404 from Apache server.
error : Not Found The requested URL /index.php was not found on this server. Apache/2.4.18 (Ubuntu) Server at roy.my-domain.com Port 80
I've read every article for 2 days and didn't found a solution....
So here are my settings :
Checked for rewrite mod in Apache - got "Module rewrite already enabled" My project is in /var/www/roy/ so the url is roy.my-domain.com/roy
Apache2.conf
<Directory /var/www/html/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> AccessFileName .htaccess
.htaccess
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase /roy/ RewriteRule ^([a-z0-9_-]+)\.html$ index.php/page/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|asset|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>
config.php
$config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'].'/roy/'; $config['index_page'] = '';
autoload.php (i'm using Twig)
$autoload['libraries'] = array('database','session','twig');
- I added permissions to both logs and cache dir
The controllers structure
name Login.php - class Login extends CI_Controller
roy.my-domain.com/roy
the publicly accessible URL? – MrWhite