Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
托管到域服务器时Codeigniter部署问题_Codeigniter_Codeigniter 3_Cpanel - Fatal编程技术网

托管到域服务器时Codeigniter部署问题

托管到域服务器时Codeigniter部署问题,codeigniter,codeigniter-3,cpanel,Codeigniter,Codeigniter 3,Cpanel,该项目在本地运行良好$config['base_url']=“localhost/” Codeigniter正在获取默认控制器welcome and login.php,但是login.php没有从assets文件夹获取资源 找不到资源的所有get请求。我检查时发现错误 xGET example.com/assets/TEMPLATE/LoginPage/vendor/bootstrap/css/bootstrap.min.css net::ERR_中止404 Cpanel public_ht

该项目在本地运行良好$config['base_url']=“localhost/”


Codeigniter正在获取默认控制器welcome and login.php,
但是login.php没有从assets文件夹获取资源

找不到资源的所有get请求。我检查时发现错误
xGET example.com/assets/TEMPLATE/LoginPage/vendor/bootstrap/css/bootstrap.min.css
net::ERR_中止404


Cpanel public_html中的CodeIgniter文件夹结构
+应用程序
+资产
+系统
index.php
.htaccess


我已经配置了应用程序/config/config.php
$config['base_url']=“www.mysite.com/”;
$config['index_page']=''

我已经配置了应用程序/config/autoload.php
$autoload['packages']=array('url')

.htaccess

重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?/$1[L,QSA]

页面正在加载资源:-

 <link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/TEMPLATE/LoginPage/vendor/bootstrap/css/bootstrap.min.css"> 
而不是使用href=“
资产/模板/登录页面/供应商/引导/css/bootstrap.min.css”>只需使用href=“/assets/TEMPLATE/LoginPage/vendor/bootstrap/css/bootstrap.min.css”>


另外,根据您的SSL状态,将http://或https://添加到您的基本URL。

尝试使用html helper中的link_标记。 首先在controller中加载html帮助程序,或者在config/autoload.php中使其自动加载

$autoload['helper'] = array('html');
然后尝试将其放入视图文件的头块中:

<?php echo link_tag('assets/TEMPLATE/LoginPage/vendor/bootstrap/css/bootstrap.min.css') ?>


在基本url中使用
http
https
您的问题到底是什么?我尝试将http&https添加到基本url()并替换基本url()使用/assets但仍然无法获取资源I thing时,如果有一种方法可以在不从根目录中删除.htaccess并在app/config/config.phpTry中添加索引的情况下修复此问题,那么它与模式_重写有关。php在app/config/config.phpTry中使用以下命令更改htaccess文件:add-RewriteRule.*index.php/$0[PT,L]&remove-RewriteRule^(.*)$index.php?/$1[L,QSA]我添加了https,当我将大写字母改为小写字母时,它起作用了->/TEMPLATE/LoginPage/with/TEMPLATE/LoginPage。