【问题标题】:CodeIgniter project localhost to live server transferCodeIgniter 项目 localhost 到实时服务器传输
【发布时间】:2019-12-12 18:18:10
【问题描述】:

我想将我的 CI 项目从本地主机传输到实时服务器,所以我使用 FTP 客户端将我所有的 CI 项目文件夹复制到 public_html 文件夹。

我也修改了config.php base_url fileroutes.php default_controller.htaccess directory。但没有任何效果。

public_html 目录树:

.htaccess

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]

config.php:

$config['base_url'] = 'http://xxxxxxxx.com/';

Others 目录包含我的 css/js/img 文件,并且都是使用 base_url() 调用的,所以我认为这不是问题

public_html文件夹中的.htaccess文件被隐藏;我不知道为什么,但是当我搜索时,它是在这里找到的。

【问题讨论】:

  • 您在 routes.php 中做了哪些更改(将文件移动到实时服务器时无需进行更改)?
  • @Tpojka 我的意思是,确保我的 default_controller 是我使用的那个。什么都没改变,只是说没关系。以防万一有人问这个!
  • .htaccess 中,您需要RewriteBase 的值,即如果它位于服务器的根目录中,我想这是因为文件夹名称public_htmlRewriteBase /
  • @Tpojka 刚刚尝试RewriteBase / 并刷新了我的网站。 404 未找到!

标签: php .htaccess codeigniter mod-rewrite


【解决方案1】:

以 . 开头的文件。被认为隐藏在 Unix 世界中。如果您将 ftp 程序选项更改为显示隐藏文件,您应该可以看到它。

【讨论】:

  • 感谢兄弟的信息,不知道:)
  • 如果您觉得有帮助,请标记为答案!
  • 缺乏声誉点,所以我无法做到这一点。对不起兄弟 ! :( 当我得到足够的分数时,我会肯定地标记它,你会看到 :D
  • 你是怎么解决这个问题的?我现在正面临这个问题。如何处理 ftp 程序选项?
猜你喜欢
  • 2015-07-18
  • 1970-01-01
  • 1970-01-01
  • 2016-04-18
  • 2017-08-25
  • 2017-03-28
  • 1970-01-01
  • 2021-10-05
  • 1970-01-01
相关资源
最近更新 更多