在我的笔记本电脑(本地主机)上运行时,我的 Yii 站点运行良好。但是,当复制到 GoDaddy.com 并从那里运行时,我收到以下错误消息:
未找到
在此服务器上未找到请求的 URL /website/Search_Best_Boat_Deals。
此外,在尝试使用 ErrorDocument 处理请求时遇到 404 Not Found 错误。website.com 上的 Apache 服务器端口 80
我的main.php
配置文件有如下配置用于 URL 管理
'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>',
'Search_Best_Boat_Deals'=>'site/vessels',
'<slug:[a-zA-Z0-9-%]+>/'=>'site/Detailview',
'message/inboxview/<messageId:[0-9]+>/'=>'message/inboxview',
'message/view/<messageId:[0-9]+>/'=>'message/view',
'message/sentview/<messageId:[0-9]+>/'=>'message/sentview',
'message/compose/<id:[0-9]+>/<VesselId:[0-9]+>'=>'message/compose',
'Gallery/ajaxUpload/gallery_id/<gallery_id:[0-9]+>'=>'Gallery/ajaxUpload',
'site/activate/key/<key:[0-9]+>/mail/<mail:[0-9]+>'=>'site/activate',
),
),
我的.htaccess
文件如下:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule ^([a-zA-Z0-9\-]+)$ index.php?page=$1 [L,NC]
有什么问题?