Yii Application在localhost上可以正常工作,但是会抛出“未找到”。 GoDaddy.com上的错误 [英] Yii Application works fine on localhost, but throws "not found" error on GoDaddy.com
问题描述
我的Yii网站在我的笔记本电脑(本地主机)上运行时,运行正常。但是,当复制到GoDaddy.com并从那里运行时,我得到以下错误消息:
My Yii site works perfectly fine, when run on my laptop (localhost). But, when copied to GoDaddy.com and run from there, I'm getting following error message:
未找到
Not Found
在此服务器的
上找不到请求的URL / website / Search_Best_Boat_Deals。
The requested URL /website/Search_Best_Boat_Deals was not found on this server.
此外,未找到404错误尝试
使用ErrorDocument处理请求时遇到错误。
website.com端口80上的Apache服务器
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache Server at website.com Port 80
我的 main.php
配置文件具有以下URL管理配置
My main.php
configuration file has the following configuration for URL management
'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]
怎么了?
推荐答案
伙计!感谢您的帮助。 .htaccess中的以下内容对我有用
Guy! I appreciate all your help. The following in the .htaccess worked for me
Options +FollowSymLinks
IndexIgnore */*
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L]
</IfModule>
这篇关于Yii Application在localhost上可以正常工作,但是会抛出“未找到”。 GoDaddy.com上的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!