codeigniter应用软件可在HostGator的,但不是另一个虚拟主机 [英] codeigniter application works on hostgator but not another web host
问题描述
我有工作完全在我的HostGator的托管域codeigniter应用程序。
I have a codeigniter application that is working perfectly on my hostgator hosted domain.
我已经配置的.htaccess和config.php文件从URL中删除的index.php。如前所述,这是工作的100%。我现在需要从我的HostGator的服务器移动应用程序在南非的本地服务器Afrihost。
I have configured .htaccess and config.php to remove the index.php from the URL. As mentioned this is working 100%. I now need to move the application from my hostgator server to a local server in South Africa with Afrihost.
修改htaccess以及配置文件如下:
the modified htaccess and config file are shown below:
我的htaccess的文件是:
RewriteEngine on
RewriteBase /
# Prevent CI index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
# Prevent user access to the CI system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
# Prevent user access to the CI application folder
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
和我config.php文件是:
and my config.php file is:
$config['base_url'] = 'http://logicoportal.co.za';
$config['index_page'] = '';
// let me know if you need to see any other setting
当我尝试浏览域 http://www.logicoportal.co.za 我得到错误本页面无法显示
。
When I try to browse to the domain http://www.logicoportal.co.za I get error This page can't be displayed
.
如果我浏览到我的离子身份验证器, http://logicoportal.co.za/auth/login 我得到404错误的网页无法找到
。
If I browse to my ion auth controller, http://logicoportal.co.za/auth/login I get 404 error The webpage cannot be found
.
如果我浏览到我的全部codeigniter默认路径,的http:// logicoportal .co.za / index.php文件/认证/注册我得到错误本页面无法显示
If I browse to my full codeigniter default path, http://logicoportal.co.za/index.php/auth/login I get error This page can't be displayed
我假定这是一个htaccess配置错误,但我不知道如何纠正这一点。看了很多,没有运气的文章。或者是有支持这个在codeigniter另一种配置设置?
I am assuming it is an htaccess configuration error however I am not sure how to correct this. read many an article with no luck. Alternatively is there another config setting in codeigniter to support this?
我曾到新的托管公司,Afrihost,他们说他们不能在这方面帮助。
I have spoken to the new hosting company, Afrihost and they say they cannot help in this regard.
任何意见/方向将AP preciated。
Any advice / direction would be appreciated.
感谢一如既往。
推荐答案
工作方案: htaccess文件删除index.php文件共享托管服务器上
Working Solution: htaccess file to remove index.php on shared hosting server
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_URI} !^(index\.php|\.swf|forums|images|css|downloads|js|robots\.txt|favicon\.ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) ./index.php [L]
这篇关于codeigniter应用软件可在HostGator的,但不是另一个虚拟主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!