移除的index.php没有code点火器与我活的服务器工作 [英] remove index.php not working with my live server in Code Igniter

查看:160
本文介绍了移除的index.php没有code点火器与我活的服务器工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

删除index.php文件不符合我活的服务器工作

这是工作在我的本地服务器

我曾尝试以下code

  RewriteEngine叙述上
的RewriteCond $ 1 ^(指数\\ .PHP |资源|机器人\\ .txt)的!
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^(。*)$的index.php / $ 1 [L,QSA]

这是在本地WAMP服务器的工作,但不是在活的服务器

的config.php 的细节

  $配置['BASE_URL'] ='http://ec2-174-129-44-226.compute-1.amazonaws.com/';
$配置['index_page'] ='';
$配置['uri_protocol'] ='自动';
$配置['url_suffix才能'] ='';
$配置['语言'] ='英语';


解决方案

我已经张贴了这个答案几十个时间(2)中有意见的问题是某链接simmilar到你。

请转到的config / config.php文件,找到这个变量

$配置['index_page'] ='的index.php'确保它看起来像这样 $配置['index_page'] =' ';

在同一文件中找到 $配置['BASE_URL'] =''; 确保它看起来像这样

$配置['BASE_URL'] ='http://ec2-174-129-44-226.compute-1.amazonaws.com/';

核心文件夹中还(其中系统中,应用程序)创建的.htaccess文件,并确保它看起来像这样

 < IfModule mod_rewrite.c>
    RewriteEngine叙述在
    的RewriteBase /    #Removes被用户访问到系统文件夹。
    #Additionally这将允许您创建一个System.php控制器,
    #previously这将是不可能。
    #'系统'可以,如果你已重命名系统文件夹进行更换。
    的RewriteCond%{REQUEST_URI} ^系统。*
    重写规则^(。*)$ /index.php?/$1 [L]    #当你的应用程序文件夹没有在系统文件夹
    #此片段prevents用户访问应用程序文件夹
    Fabdrol:由#Submitted
    #Rename'应用'到您的应用程序文件夹名称。
    的RewriteCond%{REQUEST_URI} ^应用。*
    重写规则^(。*)$ /index.php?/$1 [L]    #Checks看到,如果用户试图访问一个有效的文件,
    #such作为图像或CSS文件,如果这是不正确的发送的
    #request到index.php
    的RewriteCond%{} REQUEST_FILENAME!-f
    的RewriteCond%{} REQUEST_FILENAME!-d
    重写规则^(。*)$的index.php?/ $ 1 [L]
< / IfModule><!IfModule mod_rewrite.c>
    #如果我们没有mod_rewrite的安装,所有404的
    #可以发送到index.php,一切工作正常。
    ElliotHaughin:#提交    的ErrorDocument 404的index.php
< / IfModule>

remove index.php not working with my live server

it's work in my local server

I have Tried Below code

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

It's work in local wamp server but not in live server

Config.php detail

$config['base_url'] = 'http://ec2-174-129-44-226.compute-1.amazonaws.com/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '';
$config['language'] = 'english';

解决方案

I've posted this answer dozens of time (2) there is a link in comments to a question simmilar to yours.

Please go to config/config.php and find this variable

$config['index_page'] = 'index.php' make sure it looks like this $config['index_page'] = '';

in the same file find $config['base_url'] = ''; make sure it looks like this

$config['base_url'] = 'http://ec2-174-129-44-226.compute-1.amazonaws.com/';

Also in core folder (where system, application is) create .htaccess file and make sure it looks like this

<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>

这篇关于移除的index.php没有code点火器与我活的服务器工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆