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

后端 未结 6 656
情深已故
情深已故 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:08

    Its a three step process

    1. Configure apache mod_rewrite,run in terminal. sudo a2enmod rewrite

    2. add the following code to /etc/apache2/sites-available/default

    DocumentRoot /var/www
    
    Options FollowSymLinks
    AllowOverride All
    
    
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
    
    

    3.Restart apache

    /etc/init.d/apache2 restart
    

提交回复
热议问题