LoginSignup
68

More than 5 years have passed since last update.

posted at

updated at

Ubuntu版Apache2でmod_rewriteを有効にする

Ubuntuのリポジトリから取得出来るApache2は
オリジナルのApache2とはディレクトリの構成や設定の方法が違うらしい。

まずはmod_rewriteが利用可能となっているかを確認する。

cat /etc/apache2/mods-available/rewrite.load
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

使えることが確認できたらa2enmodというコマンドを実行する。

sudo a2enmod rewrite

a2enmodを実行すると以下の様なメッセージが出てくる。

Enabling module rewrite.
To activate the new configuration, you need to run:
  service apache2 restart

忘れずにrestartしよう

sudo service apache2 restart

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
68