GoDaddy服务器上的CodeIgniter和URI问题 [英] Problem with CodeIgniter and URI on GoDaddy servers

查看:39
本文介绍了GoDaddy服务器上的CodeIgniter和URI问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法在GoDaddy上正确设置CodeIgniter.我尝试在"wecome"控制器内创建一个新函数.但是我无法在任何地方访问它.

I can't seem to get CodeIgniter set up properly on GoDaddy. I tried creating a new function inside of the 'wecome' controller. But I can't access it anywhere.

http://domain.com/test   (No response) <- why doesn't this work
http://domain.com/index.php/welcome/test   (No response) <- why doesn't this work

只是为了让您了解默认欢迎页面的解析方式:

And just to give you an idea of how the default welcome page resolves:

http://domain.com/   (resolves to welcome page aka 'index' function)
http://domain.com/index.php/   (resolves to welcome page aka 'index' function)
http://domain.com/index.php/welcome   (No response) <- why doesn't this work?
http://domain.com/index.php/welcome/index (No response) <-why doesn't this work?

如何正确设置此设置?

推荐答案

步骤1.在根目录的.htaccess文件中,将此设置为:

step 1. in your .htaccess file on root directory set this:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteCond %{HTTP_HOST} ^mydomain.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]

第2步.打开/system/application/config/config.php文件,并确保设置了以下两个选项.

step 2. open /system/application/config/config.php file and make sure the following two options are set.

$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";

希望这会有所帮助.

这篇关于GoDaddy服务器上的CodeIgniter和URI问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆