3

I am using ubuntu 14.04 and have LAMP environment. I have one of the project in dir /var/www/html/project1 . It can't access the .htaccess file for rewriting url rules.

For that i have to change in /etc/apache2/apache2.conf file

   <Directory /var/www/>
          Options Indexes FollowSymLinks
          AllowOverride All       # change None to All
          Order allow,deny
          allow from all
          Require all granted
   </Directory>

But after this change my Apache server gives an error "Internal Server error"

And If I'll change 'AllowOverride None' then site is running correctly But .htaccess file doen't work.

2
  • 3
    Is rewrite enabled? sudo a2enmod rewrite followed by sudo service apache2 restart . If yes, then I think the issue is in your .htaccess file. Perhaps add its content to your question. Jun 25, 2015 at 14:20
  • @Doug, I think you need to put that comment as an answer. And it should be the accepted answer too. I know I'd vote +1 for your answer!
    – patrick
    Dec 8, 2015 at 23:20

2 Answers 2

3

I had the same issue. After searching a lot I have found that @Doug Smythies's way perfectly work for me. Up vote.

So I go to the terminal and run the following code:

sudo a2enmod rewrite
sudo service apache2 restart

And that's it. Hope this will help others.

0
<Directory /var/www/html/project1>
  Options Indexes FollowSymLinks
  AllowOverride All
  Order allow,deny
  allow from all
  Require all granted
</Directory>

Remove project 1 from your directory name and then solve the problem only one word

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .