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.

  • 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. – Doug Smythies Jun 25 '15 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 '15 at 23:20

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.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.