htaccess works in localhost but doesn't work in EC2 instance

后端 未结 6 649
情深已故
情深已故 2020-12-14 19:36

My htaccess file works on localhost but doesn\'t work when i deploy it to EC2 instance.

I\'m using Macbook and in finder i cannot see the htaccess file, i thought t

6条回答
  •  死守一世寂寞
    2020-12-14 20:11

    When you using the apache2 server

    Go to the following directory.

    cd /etc/apache2/sites-available

    If you use LS command here you will see the following file.

    000-default.conf

    That's the file with default apache configuration which are applied to your sites in /var/www/html folder.

    Open this file for editing.

    sudo nano 000-default.conf

    Add following lines after DocumentRoot /var/www/html line.

    Options FollowSymLinks AllowOverride All Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all
    

    Save the file and restart the apache.

    sudo service apache2 restart

    that's it and now your .htaccess file will work

提交回复
热议问题