Skip to content
Advertisement

Htaccess giving 404 error on Aws Linux 2 AMI

I have set up an elastic beanstalk and deployed my application to it, the application has a .htaccess file in it. .htaccess works perfectly on my localhost but when checking it on the live server it gives back a 404 error.

For Example

I have a login file named login_1.php, on my .htaccess I’ve set the file to be called login.

When clicking the login link on my localhost it sends me to the login_1.php file with the URL name of login, but when clicking on the login link on the live server it takes me to a 404 error.

I’ve followed all instructions on the internet regarding this issue but nothing seems to solve the problem. I’ve changed AllowOverride None to AllowOverride All on my httpd.conf file. I do not have apache on my ec2 Linux 2 AMI instance so I can’t restart apache.

Any help would be much appreciated to fix this.

Thanks, Arnav

Advertisement

Answer

Figured out the answer, went into my elastic beanstalk application and changed the application type to APACHE instead of NGINX. This start httpd sever and allowed me to activate the .htaccess file in my application.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement