twitter facebook

ubuntu で apache で RewriteEngine のエラー

ubuntu で apache にアクセスすると internet server error がブラウザに表示されたので
tail -f /var/log/apache2/error.log
エラーログ
~ .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer
.htaccess の RewriteEngine が使えないということで
確認
ls /etc/apache2/mods-enabled
access_compat.load authn_core.load authz_user.load deflate.load filter.load mpm_event.load reqtimeout.load status.load alias.conf authn_file.load autoindex.conf dir.conf mime.conf negotiation.conf setenvif.conf alias.load authz_core.load autoindex.load dir.load mime.load negotiation.load setenvif.load auth_basic.load authz_host.load deflate.conf env.load mpm_event.conf reqtimeout.conf status.conf
モジュールを有効に
a2enmod rewrite
Enabling module rewrite. To activate the new configuration, you need to run:
systemctl restart apache2
これで RewriteEngine がつかえて、InternetServerError は解消されました。
AUTHOR
@hiropon
最終更新日 2021/03/02
FAVORITE good stock
LINK TAG
記法を見る