ubuntuの.htaccess有効化

更新日 2020-09-03 13:19:09
ubuntu
ubuntuのapache2では.htaccessがデフォルトで無効であるため、有効化が必要である。

mod_rewrite.soモジュールを有効化


sudo /usr/sbin/a2enmod rewrite

apache2.confの設定

AllowOverrideをAllにする

vi /etc/apache2/apache2.conf
<Directory /var/www/>
AllowOverride All
</Directory>

apache2を再起動


systemctl restart apache2