user3608238
user3608238

Reputation: 425

Cannot Edit htaccess file on EC2/Elastic Beanstalk

I am attempting to edit my htaccess file on my EC2 server, however when I enter the command:

sudo a2enmod rewrite I get the response sudo: a2enmod: command not found. I have edited the httpd.conf file and set to AllowOveride All for /var/www and also tried for and restart apache but still getting the same message.

Upvotes: 0

Views: 1343

Answers (1)

nauten
nauten

Reputation: 497

I'm going to assume you're using an Amazon Linux AMI as that's what you get out of the box with Beanstalk. The a2enmod command does not come with Amazon's Linux build - that's why you're seeing the command not found error.

However, you are in luck. The Beanstalk AMI configured with Apache2 has the rewrite module enabled by default, so you don't have to do anything special to get it working. Since you already have your httpd.conf setup correctly, the only thing you do have to do to start using rewrite rules it put them in your .htaccess file, and place that in your webroot (or subfolder if that's what you need).

Hope this helps!

Upvotes: 2

Related Questions