Ubuntu 17.04 Apache2 mod_rewriteを有効にする

そもそもmod_rewriteが利用可能となっているかを確認。

cat /etc/apache2/mods-available/rewrite.load

「LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so」と表示された人は使えるみたいです。

次に

sudo a2enmod rewrite

を実行する。

$ sudo a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
systemctl restart apache2

こうなった。

sudo service apache2 restart

リスタートして完了。

Linux, PHP

Posted by bistro