rewrite ruleを設定してみる
参考:
http://oxynotes.com/?p=7392
http://qiita.com/s2maeda/items/21d9458e44f86597d1ae
https://teratail.com/questions/1239
http://phantom37383.blog.fc2.com/blog-entry-1551.html
https://www.gidblog.com/invalid-command-rewritelog/
以下を追加
vim /etc/apache2/apache2.conf
+LoadModule rewrite_module mod_rewrite.so
+RewriteLog /var/log/httpd/rewrite.log
+RewriteLogLevel 9
各種設定が足りなかったら追加
cd /var/log
mkdir httpd
chmod 777 httpd
ln -s /usr/lib/apache2/modules/mod_rewrite.so /etc/apache2/
apache restartでなんか出た
ubuntu@ip-172-31-28-173:/etc/apache2$ service apache2 restart
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 224 of /etc/apache2/apache2.conf:
Invalid command 'RewriteLog', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
書き方が古かったようで、apache 2.4では
LogLevel alert rewrite:trace3
としか書けないよう。(ログファイルは選べないみたい)
そしてapacheのrestart
これによって
[:http_address]/contact
のようなアドレスもアクセスできるようになった