【问题标题】:Uploading codeigniter site from local server to live将 codeigniter 站点从本地服务器上传到 live
【发布时间】:2016-11-23 18:47:09
【问题描述】:

大家好,我在 codeigniter 中创建了一个站点,它在本地服务器上运行良好。我在实时服务器上上传:域名 (http://fantastictravels.co/),上面写着“找不到这个梦幻之旅.co 页面”

我尝试了许多不同的方法,但都不起作用。这是我的视图和控制器代码:

控制器:

<?php

class Travels extends CI_Controller {

     function __construct(){
        parent :: __construct();
        $this->load->model('travel');
    }

    public function index()
    {

        $this->load->view('index');
    }
}

查看:

<head>
    <meta http-equiv="Content-Language" content="en-us">
    <title></title>
    <meta charset="utf-8">
   </head>
<body>

    <div class="content">

       This is test
    </div>
</body>
</html>

在我的配置文件中,base_url 是“http://fantastictravels.co/”,我所有的文件都位于“http://fantastictravels.co/”的根目录下。 请帮帮我。

【问题讨论】:

标签: php codeigniter web-hosting


【解决方案1】:

1st,你有一个名为index.php的查看文件吗? 您的视图文件在视图文件夹中吗?

把它放在你的 .htaccess 文件中

DirectoryIndex index.php
RewriteEngine on

RewriteCond $1 !^(index\.php|  (.*)\.swf|forums|images|css|downloads|js|robots\.txt|favicon\.ico)
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

转到您的配置文件,并确保该行如下所示

$config['index_page'] = '';

【讨论】:

    【解决方案2】:

    我的控制器和模型文件名是小写字母,我改成大写字母,它变得固定... :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-17
      • 2018-11-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-20
      • 1970-01-01
      相关资源
      最近更新 更多