私は mac os x 10.6.8 を使用していますが、mod_rewrite に問題があります。動作しません。
とでAllowOverride Allを変更しました。/etc/apache2/users/my_user.conf
/etc/apache2/httpd.conf
.htaccess コード:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
PHP:
var_dump($_GET['q']);
結果:
Trying: http://localhost/~nonamez123/konkurs/asgfsddsh
Not Found
The requested URL /Users/nonamez123/Sites/konkurs/index.php was not found on this server.
ご覧のとおり、書き直しがindex.php
進んでいますが、index.php
が見つかりません
ログ:
127.0.0.1 - - [25/Sep/2012:21:06:13 +0300] [localhost/sid#10080d720][rid#1009d64a8/initial] (3) [perdir
/Users/nonamez123/Sites/konkurs/] strip per-dir prefix:
/Users/nonamez123/Sites/konkurs/asfdasdf - asfdasdf
127.0.0.1 - - [25/Sep/2012:21:06:13 +0300] [localhost/sid#10080d720][rid#1009d64a8/initial] (3) [perdir
/Users/nonamez123/Sites/konkurs/] applying pattern '^(.*)$' to uri
'asfdasdf'
127.0.0.1 - - [25/Sep/2012:21:06:13 +0300] [localhost/sid#10080d720][rid#1009d64a8/initial] (4) [perdir
/Users/nonamez123/Sites/konkurs/] RewriteCond:
input='/Users/nonamez123/Sites/konkurs/asfdasdf' pattern='!-f' =>
matched
127.0.0.1 - - [25/Sep/2012:21:06:13 +0300] [localhost/sid#10080d720][rid#1009d64a8/initial] (4) [perdir
/Users/nonamez123/Sites/konkurs/] RewriteCond:
input='/Users/nonamez123/Sites/konkurs/asfdasdf' pattern='!-d' =>
matched
127.0.0.1 - - [25/Sep/2012:21:06:13 +0300] [localhost/sid#10080d720][rid#1009d64a8/initial] (2) [perdir
/Users/nonamez123/Sites/konkurs/] rewrite 'asfdasdf' ->
'index.php?q=asfdasdf'
127.0.0.1 - - [25/Sep/2012:21:06:13 +0300] [localhost/sid#10080d720][rid#1009d64a8/initial] (3) split
uri=index.php?q=asfdasdf - uri=index.php, args=q=asfdasdf
127.0.0.1 - - [25/Sep/2012:21:06:13 +0300] [localhost/sid#10080d720][rid#1009d64a8/initial] (3) [perdir
/Users/nonamez123/Sites/konkurs/] add per-dir prefix: index.php ->
/Users/nonamez123/Sites/konkurs/index.php
127.0.0.1 - - [25/Sep/2012:21:06:13 +0300] [localhost/sid#10080d720][rid#1009d64a8/initial] (1) [perdir
/Users/nonamez123/Sites/konkurs/] internal redirect with
/Users/nonamez123/Sites/konkurs/index.php [INTERNAL REDIRECT]