時々mod_rewrite が動かずに悩まされるときがある。
原因は「mod_rewrite」ばかりではない。
.htaccess が有効になっていないことが多い。
AllowOverride が All になっているか確認する。
mod_rewrite のソースに文法エラーを書いてみて「Internal Server Error」になれば.htaccessは有効になっているはず?
↑この組み合わせでしか動かなかった。
<Directory />
Options FollowSymLinks
AllowOverride none
Order deny,allow
Deny from all
</Directory>
<Directory "F:/home">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Options ExecCGI
</Directory>
自分の作業用サーバーでは、上記だけではどうさせず
.htaccess に[Options +FollowSymLinks]を追記したら動いた。
#mode_rewriteの設定
Options +FollowSymLinks
RewriteEngine on
RewriteBase /demo/hanryu-next.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9]+).php? user_data/$1.php [L]