Search code examples
apache.htaccessapache2ubuntu-16.04ubuntu-server

.htaccess is not working on aws ec2 multi domain hosted


.htaccess isn't working on my server. I'm hosting 2 domains on that server. I installed phpmyadmin using-> Secure phpmyadmin.

.htaccess for serverip/phpmyadmin/ is working fine but not for the other domains.


Solution

  • Got it Solved !! I added few lines of code in VirtualHost just below the Document Root-

    VirtualHost File Located in my case was - /etc/apache2/sites-available/example.com.conf

    Added Below -

    DocumentRoot /var/www/example.com/public_html
    

    I added -

    <Directory /var/www/example.com/public_html>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      allow from all
    </Directory>
    

    I repeated same with my other domain VirtualHost File.

    Then Apache2 Restart - sudo service apache2 restart

    I hope this helps to people :)