I just moved my project to EC2 and I can't get my .htaccess to work properly for removing index.php. When attempting to access my website, I receive the following error message - "The requested URL /nutrition/auth/login was not found on this server". I have tried numerous .htaccess files and switched my
uri_protocol back and forth between 'REQUEST_URI' and 'AUTO'.
The folder structure of where my project is located is /var/www/html/nutrition/
I have verified that
mod_rewrite is enabled. It shows as a loaded module when I view phpinfo.
I have set
AllowOverride All in httpd.conf:
Code:
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride All
Require all denied
</Directory>
Code:
#
# Relax access to content within /var/www.
#
<Directory "/var/www">
AllowOverride All
# Allow open access:
Require all granted
</Directory>
base_url in config.php is set to:
PHP Code:
$config['base_url'] = 'http://<ip_address>/nutrition/';
index_page in config.php is set to:
PHP Code:
$config['index_page'] = '';
uri_protocol in config.php is set to:
PHP Code:
$config['uri_protocol'] = 'REQUEST_URI';
.htaccess file is:
Code:
RewriteEngine On
RewriteBase /nutrition/
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
I know this is a common question that I'm sure you're tired of answering, but I have tried numerous offered solutions to no avail. Thanks for any help you all can give.