Php 正在将codeigniter项目上载为服务器的子域
我见过类似的问题,但我尝试了所有这些答案,但它们都不起作用,所以我不得不问这个问题,对此表示抱歉 我试图上传一个基于codeigniter的项目到服务器,但我得到404页面未找到错误显示,但我可以看到fav图标 最新访问权限为Php 正在将codeigniter项目上载为服务器的子域,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,我见过类似的问题,但我尝试了所有这些答案,但它们都不起作用,所以我不得不问这个问题,对此表示抱歉 我试图上传一个基于codeigniter的项目到服务器,但我得到404页面未找到错误显示,但我可以看到fav图标 最新访问权限为 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / #Removes access to the system folder by users. #Additiona
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
重新启动发动机
重写基/
#删除用户对系统文件夹的访问权限。
#此外,这将允许您创建System.php控制器,
#以前这是不可能的。
#如果已重命名系统文件夹,则可以替换“系统”。
重写COND%{REQUEST_URI}^系统*
重写规则^(.*)$/index.php?/$1[L]
#当应用程序文件夹不在系统文件夹中时
#此代码段阻止用户访问应用程序文件夹
#提交人:Fabdrol
#将“应用程序”重命名为应用程序文件夹名称。
重写cond%{REQUEST_URI}^应用程序*
重写规则^(.*)$/index.php?/$1[L]
#检查用户是否试图访问有效文件,
#例如图像或css文档,如果这不是真的,它会发送
#请求index.php
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php?/$1[L]
#如果我们没有安装mod_rewrite,所有404
#可以发送到index.php,一切正常。
#提交人:ElliotHaughin
ErrorDocument 404/index.php
php的前几行是
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'http://demos.ededge.in/';
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = '';
遵循以下步骤:
1) 控制器类名称应以大写字母开头
2) 文件名应以大写字母开头
因为Linux区分大小写。请遵循以下步骤:
1) 控制器类名称应以大写字母开头
2) 文件名应以大写字母开头
因为Linux区分大小写。基本设置过程:
1) 首先,您需要将您的子域指向托管服务器上的特定文件夹路径
2) 将代码上载到指向的子域文件夹路径
3) 检查文件夹和文件所有者组和权限。文件夹权限755和文件权限644
4) 创建数据库并导入数据库SQL文件
5) 在/application/config/config.php中配置基本URL
$config['base_url'] = 'http://sub-domain.domain.com/';
6) 更改配置文件中的加密密钥
$config['encryption_key'] = 'to_any_16_character_alpha_numeric_special_character';
注意:不要在键中使用“$”。PHP是一个变量,
7) 在/application/config/database.php中配置数据库连接
$db['default']['hostname'] = "database_hostname";
$db['default']['username'] = "database_username";
$db['default']['password'] = "database_password";
$db['default']['database'] = "database_name";
$db['default']['dbdriver'] = 'database_driver';
注:
-您需要在创建的数据库中为数据库用户分配适当的权限。
-选择合适的数据库驱动程序名称,如“mysqli”
8) 如果不希望URL中包含index.php,请检查.htaccess代码。重写模块的基本.htaccess代码
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
基本设置过程:
1) 首先,您需要将您的子域指向托管服务器上的特定文件夹路径
2) 将代码上载到指向的子域文件夹路径
3) 检查文件夹和文件所有者组和权限。文件夹权限755和文件权限644
4) 创建数据库并导入数据库SQL文件
5) 在/application/config/config.php中配置基本URL
$config['base_url'] = 'http://sub-domain.domain.com/';
6) 更改配置文件中的加密密钥
$config['encryption_key'] = 'to_any_16_character_alpha_numeric_special_character';
注意:不要在键中使用“$”。PHP是一个变量,
7) 在/application/config/database.php中配置数据库连接
$db['default']['hostname'] = "database_hostname";
$db['default']['username'] = "database_username";
$db['default']['password'] = "database_password";
$db['default']['database'] = "database_name";
$db['default']['dbdriver'] = 'database_driver';
注:
-您需要在创建的数据库中为数据库用户分配适当的权限。
-选择合适的数据库驱动程序名称,如“mysqli”
8) 如果不希望URL中包含index.php,请检查.htaccess代码。重写模块的基本.htaccess代码
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
首先检查控制器类名应以大写字母开头。您的服务器是Linux?我可以更改哪个文件名或类名?我检查了控制器类名E5,它是大写字母文件名也是大写字母。首先检查控制器类名应以大写字母开头。您的服务器是Linux?我可以更改哪个文件名或类名称我检查了控制器类名E9,该类名用大写字母表示,文件名也用大写字母表示。现在我对用户'edgein_edge'@'198.134.120.4'的错误访问被拒绝(使用密码:是)检查您的配置文件并将您的凭据与服务器匹配。现在我对用户'edgein_edge'@'198.134.120.4'的错误访问被拒绝(使用密码:是)检查您的配置文件并将您的凭据与服务器匹配。