Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从codeigniter中删除index.php_Php_.htaccess_Codeigniter_Twitter Bootstrap - Fatal编程技术网

从codeigniter中删除index.php

从codeigniter中删除index.php,php,.htaccess,codeigniter,twitter-bootstrap,Php,.htaccess,Codeigniter,Twitter Bootstrap,从现在起。。。这是我运行应用程序时显示的地址(并且它是功能性的) 如果我去掉index.php,它也可以工作 http://localhost:8888/baseline/ 运行这两个URI与运行此函数(功能性)相同 但是如果我尝试在没有index.php的情况下运行它,它将无法正常运行 http://localhost:8888/baseline/RegisterController/index 在我的代码中,我有2.htaccess文件 在“视图”的正下方,代码如下 Deny from

从现在起。。。这是我运行应用程序时显示的地址(并且它是功能性的)

如果我去掉index.php,它也可以工作

http://localhost:8888/baseline/
运行这两个URI与运行此函数(功能性)相同

但是如果我尝试在没有index.php的情况下运行它,它将无法正常运行

http://localhost:8888/baseline/RegisterController/index
在我的代码中,我有2.htaccess文件

在“视图”的正下方,代码如下

Deny from all
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L] 
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L] 

# my url is http://localhost/arny
#RewriteBase /arny/
# set your own
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>
在“系统”下面的代码是

Deny from all
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L] 
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L] 

# my url is http://localhost/arny
#RewriteBase /arny/
# set your own
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>
AddDefaultCharset UTF-8
重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则。*index.php/$0[PT,L]
#我的网址是http://localhost/arny
#阿尼/
#自己设定
重写基/
#删除用户对系统文件夹的访问权限。
#此外,这将允许您创建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]
这就是我的配置文件的样子。。。

我试着将它从“自动”设置为“路径信息”,但在那里没有任何运气。 有人谈论过在Apache上改变一些东西,但我不知道如何做到这一点

我已经检查了以下帖子,但无法使其正常工作

我现在正在运行

  • Netbeans 7.3.1
  • CodeIgniter+Twitter引导模板
  • MAMP 2.2

一定要让我知道我还能提供什么信息,我会重新编辑这篇文章。在费力阅读了这些其他文档之后,我确实觉得自己像个白痴,但仍然无法弄明白这一点

我也一直在玩弄它。这是一个适合我的,我害怕碰它:;)j/k

它位于应用程序/系统/用户指南目录之外。资源是我自己的公用文件夹,请忽略该行

我还没有接触内部的.htaccess文件。他们就是这样:

Deny from all
希望这有帮助:)

编辑:同时检查是否已启用mod_重写


还有这个

尝试在系统文件夹下使用此选项。这将允许通过所需的扩展。(样式表、脚本等)


你的Apache服务器上是否启用了ModRewrite?你真是太神奇了。这就是诀窍!我还改变了其他文件,以否认从所有以及这是什么做了!
%{REQUEST\u FILENAME}-f
已允许静态资产通过。这只是添加了一个不到前端控制器的任意路径列表。
Deny from all
RewriteEngine On

RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)

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