我在我當前的自定義PHP MVC項目中有一個非常奇怪的問題。如果控制器methodname包含show(fx show_album),apache會拋出404頁面未找到?PHP MVC:404錯誤當action-methodname包含顯示
杜你有什麼想法,爲什麼會發生這種情況?
的.htaccess:
#mod_rewrite start
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-zA-Z]*)/?([a-zA-Z]*)?/?([a-zA-Z0-9]*)?/?$ index.php?controller=$1&action=$2&id=$3 [QSA,L]
#mod_rewrite end
順便說一句。它與普通的URL的GET請求的作品(如index.php的控制器=輪廓&行動= show_album & ID = 1
當然它不是'_',因爲你的模式似乎只匹配AZ(不是下劃線)? – naththedeveloper