我见过类似的问题,但是我尝试了所有的答案,但是他们没有工作,所以我不得不问这个问题对不起
我正在尝试将基于codeigniter的项目上传到服务器但我得到404页面未找到错误显示但我可以看到fav图标
最新的htaccess是
<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>
配置.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'] = '';
我上传到名为demos的文件夹
答案 0 :(得分:2)
请按照以下步骤操作:
1)控制器类名称应以大写字母开头。
2)文件名名称应以大写字母开头。
因为Linux区分大小写。
答案 1 :(得分:0)
基本设置流程:
1)首先,您需要将子域指向托管服务器上的特定文件夹路径。
2)将代码上传到指向的子域文件夹路径。
3)检查文件夹和文件所有者组和权限。文件夹权限755和文件权限644。
4)创建数据库并导入数据库SQL文件。
5)在/application/config/config.php
中配置BASE_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]