我想在godaddy hosting上运行基于codeigniter的投资组合网站。该网站的网址是www.wghclabs.com 该网站在我的本地开发服务器上运行良好(我使用MAMP),但是当使用godaddy我无法实现数据库连接,也无法显示除主页以外的任何页面。 我用htaccess重写了URL。 我尝试了所有我能想到的,我真的迷失在这里......如果有人能指点我在哪里寻找,我会很感激。 这里是我的.htaccess文件的一个副本codeigniter与godaddy设置
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wghclabs.com/
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
感谢
当它试图连接到数据库时,你会得到什么错误?当你将codeigniter上传到godaddy时,你可能没有更新数据库信息。 – Mythrillic
你有没有改变你的'application/config/database.php'中的数据库设置?特别是'主机名,用户名和密码' –
我认为问题出在你的控制器类上,因为你的视图工作不正常。 –