sourabh kasliwal
sourabh kasliwal

Reputation: 977

htaccess not working on EC2 Ubuntu instance

I am having an Amazon EC2 Instance, I have enable the mod_rewrite but htacess not working.

Also while changing /etc/apache2/sites-available/default setting AllowOverride none to AllowOverride All it is giving me internal server error.

Am I missing something.

Upvotes: 2

Views: 2011

Answers (3)

Techalgoware
Techalgoware

Reputation: 620

Suppose It's showing some Internal Server Error First, you activate ModRewrite feature:

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

Upvotes: 0

urfusion
urfusion

Reputation: 5501

Here is what I try and that work for me

  1. Open file as

sudo vim /etc/apache2/apache2.conf

  1. Second

remove comment sign (#) AccessFileName .htaccess

  1. Then find the line where there is
    <Directory /var/www/> Options Indexes FollowSymLinks AllowOverrideNone Require all granted </Directory>
    replace "None" with "All"
    AllowOverride All

I found this on https://webmasters.stackexchange.com/questions/61009/how-to-enable-use-of-htaccess-in-apache-on-ubuntu/61022#61022

Upvotes: 1

exussum
exussum

Reputation: 18550

 internal server error.

Means there is something wrong with the .htaccess file likely

Check /var/log/httpd/error.log it may give you the line. but it will tell you whats wrong

Upvotes: 1

Related Questions