在codeigniter的.htaccess错误 [英] .htaccess Error in Codeigniter

查看:141
本文介绍了在codeigniter的.htaccess错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的codeigniter我已经把在codeigniter 2.1.3根文件夹一个.htaccess。 我已经尽了.htaccess文件上都XAMPP和放大器;瓦帕服务器,但是这不是我删除的index.php。 我还设置

I am new to Codeigniter I have put an .htaccess in root folder of codeigniter 2.1.3. I have tried my .htaccess file on both xampp & wamp server but this is not removing my index.php. I have also set

 $config['index_page'] = 'index.php';

 $config['index_page'] = '';

和这里是我的.htaccess code

and here is my .htaccess code

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond $1 !^(index\.php|js|images|system\/plugins|robots\.txt|css\/)
  RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule> 

我不知道这是为什么不从URL删除我的index.php页面。 帮助我!

i dont know why this is not removing my index.php page from url. help me!!

推荐答案

打开config.php文件,一定要更改$配置['uri_protocol'] ='REQUEST_URI';

Open config.php make sure to change $config['uri_protocol']= 'REQUEST_URI';

和替代该code。在.htaccess文件

and in place this code in .htaccess file

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond $1 !^(index\.php|indexcp\.php?|resources|robots\.txt)
RewriteRule ^([A-Za-z0-9_/.-]+)$ index.php?/welcome/$1 

这就是它为我工作。让我知道如果你仍然面临的任何问题。

That's all it works for me. Let me know if you are still facing any problem.

这篇关于在codeigniter的.htaccess错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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