删除的index.php从URL - codeigniter 2 [英] Remove index.php From URL - Codeigniter 2

查看:637
本文介绍了删除的index.php从URL - codeigniter 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从我的codeigniter网址删除的index.php。我做了一些网站与codeigniter 1.7和的.htaccess code我用2不工作。

I am having trouble removing index.php from my URLs in Codeigniter. I've made a few websites with Codeigniter 1.7 and the .htaccess code I used doesn't work in 2.

我曾试过用

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

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

</IfModule>

我也试了一下没有的RewriteBase /英寸。

I've also tried it without RewriteBase / in.

我已经改变了$配置['uri_protocol']到REQUEST_URI和QUERY_STRING并没有什么。

I have changed the $config['uri_protocol'] to REQUEST_URI and QUERY_STRING and nothing.

我已经设置$配置['index_page'] =;

I have set $config['index_page'] = "";

文件结构是192.168.0.130/(site)/所以它必须被追溯到服务​​器的根并不能找到index.php文件

The file structure is 192.168.0.130/(site)/ so it must be going back to the root of the server and can't find the index.php file.

所有我已经可以达到控制器通过将192.168.0.130/(网站)/index.php/testcontroller

All of the controllers I have made can be reached by putting 192.168.0.130/(site)/index.php/testcontroller

感谢你。

道歉,如果这已经被问过 - 我已经看过,并试图什么我能看到

Apologies if this has been asked before - I have looked and tried what I could see.

编辑:

我还要补充一点,我改变了默认文件夹为

I should also add that I changed the default folders to be

应用程序

CI-2.0

的index.php

index.php

和修改的路径在index.php文件是正确的。

and changed the paths in index.php to be correct.

推荐答案

先试后公布的首code座,但代替的index.php尝试使用/(site)/index.php(OBV更换(现场)与任何站点文件夹命名)。

Try the first code block you posted, but instead of /index.php try using /(site)/index.php (obv replacing (site) with whatever your site folder is named).

这篇关于删除的index.php从URL - codeigniter 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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