![]() |
.htaccess not working on Amazon EC2 [Solved] - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: .htaccess not working on Amazon EC2 [Solved] (/showthread.php?tid=68966) |
.htaccess not working on Amazon EC2 [Solved] - dlm1897 - 09-20-2017 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: # Code: # 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 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. RE: .htaccess not working on Amazon EC2 - skunkbad - 09-20-2017 Unless your /nutrition/ directory is document root, I'd guess you just need to change your RewriteBase to / RE: .htaccess not working on Amazon EC2 - dlm1897 - 09-21-2017 (09-20-2017, 11:42 PM)skunkbad Wrote: Unless your /nutrition/ directory is document root, I'd guess you just need to change your RewriteBase to / Thanks for the reply. DocumentRoot is /var/www/html. Still get the same result after setting RewriteBase to /. RE: .htaccess not working on Amazon EC2 - dlm1897 - 09-21-2017 I have resolved the issue. Dumb mistake. There was a 3rd option to set AllowOverride All in httpd.conf. Once I set it in the code below, it worked. Code: # Further relax access to the default document root: |