一定期間更新がないため広告を表示しています
2019.01.01 Tuesday
- | | - | -
2015.06.27 Saturday
webAPI用にurlルーティングをやろうと試みたが
mod_rewriteの設定をするだけでだいぶ時間が掛かった。
やったこと
(1)apacheでmod_rewriteが有効になっているか確認
[/etc/apache2/httpd.conf ]
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
がコメントアウトされていないか確認。
(2).htaccessが有効になっているか確認
[/etc/apache2/httpd.conf ]
AllowOverride None → All ※2カ所
(3).htaccessの作成
[Users/~****/hogehoge/rute/.htaccess]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /~****/hogehoge/rute/ruto.php/$1 [L] ※localhost~のパスを設定する。最後は必ず改行。
(4)apacheの再起動
$ sudo apachectl restart
以上
mod_rewriteの設定をするだけでだいぶ時間が掛かった。
やったこと
(1)apacheでmod_rewriteが有効になっているか確認
[/etc/apache2/httpd.conf ]
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
がコメントアウトされていないか確認。
(2).htaccessが有効になっているか確認
[/etc/apache2/httpd.conf ]
AllowOverride None → All ※2カ所
(3).htaccessの作成
[Users/~****/hogehoge/rute/.htaccess]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /~****/hogehoge/rute/ruto.php/$1 [L] ※localhost~のパスを設定する。最後は必ず改行。
(4)apacheの再起動
$ sudo apachectl restart
以上