預設的.htaccess為
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/ [QSA,PT,L]
</IfModule>
此時造訪http://mydomain.me/home/index...,直接報錯Failed to load resource: the server responded with a status of 404 (Not Found)如下圖
加上index.php之後,http://mydomain.me/index.php/...,頁面可訪問,但報錯如下圖
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=/ [QSA,PT,L]
</IfModule>
請問原因出在哪裡?怎麼破?
多謝各位。
自己查到原因了,linux中要注意嚴格區分大小寫。
犯了低級錯誤。
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
試試看這個,把IF 那些移除來試試看。