0
如果我在URL中隱藏(通過.htaccess或php代碼重定向)index.php名稱腳本,規則將停止工作(404 errror)。yii urlManager:如果隱藏index.php,則停止工作規則
這意味着http://site.ru/index.php/test在開始工作,http://site.ru/test現在不工作。
我能做什麼?
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'test'=>'site/index',
),
我添加它:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
一切都很好,但現在我的404規則是不工作...
(ErrorDocument 404 /404.html)
回答
如果您不想要動態404頁面(默認在警予網站/錯誤),然後改變它:
RewriteRule . index.php
到
RewriteRule .* /404.html
這可能有助於http://stackoverflow.com/questions/13542560/removing-index-php-from-url-cause-404-in-yii?rq=1 – RajeshK
請現在在.htaccess中分享您的重定向規則 –
我的404規則不起作用 –