我有yad项目托管在Godaddy,我创建管理面板作为一个名为“管理员”的分离模块,管理面板在我的localhost工作正常,但当我将代码移动到我的主机所有管理模块控制器从两个部分示例“subCategoryController”停止工作并返回404错误,所有其他控制器只包含一个部分工作正常的例子“用户,发布,...”,他们都在我的本地主机上正常工作只在我的主机godaddy问题 . 这是我在htaccess和main.php中使用的一些代码片段:
main.php:
urlManager:
'urlManager' => array(
'urlFormat' => 'path',
'showScriptName' => false,
'caseSensitive' => false,
'rules' => array(
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
),
的.htaccess
Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
</IfModule>
我可以访问的Url示例:somewebsite.com/admin/user/index
Url的示例我无法访问godaddy,但我可以在我的localhost上访问它:somewebsite.com/admin/subCategory/index
这是我到目前为止尝试过但没有用的:
1-添加如下静态规则:
'/admin/sub-category' => '/admin/subCategory/index'
2-添加模块重写规则:
'<module:\w+>/<controller:\w+>/<id:\d+>'=>'<module>/<controller>/view',
'<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<module>/<controller>/<action>',
'<module:\w+>/<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>',
如果您需要更多信息,请告诉我,提前谢谢 .