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

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

    There are three steps

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

    2. Add this code in this file after closing VirtualHost tag /etc/apache2/sites-available/000-default.conf

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

    3. Restart apache server by command

      sudo service apache2 restart

提交回复
热议问题