首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Fedora16服务器中PHP CodeIgniter的URL中删除Index.php

从Fedora16服务器中PHP CodeIgniter的URL中删除Index.php
EN

Stack Overflow用户
提问于 2012-06-02 14:34:55
回答 2查看 588关注 0票数 0

我的web应用程序在URL中没有index.php就不能工作。它已经在我之前的笔记本电脑(OS: Ubuntu 10.10)上运行了。在我的新笔记本电脑上,在Fedora 16操作系统下,它不能工作。我做了所有的检查,像.htaccess,cofig.php等等。其他的应用程序而不是像PHPMyAdmin这样的CodeIgniter框架工作得很好。以下是我的.htaccess代码。

代码语言:javascript
复制
# Options
  Options -Multiviews
  Options +FollowSymLinks

 #Enable mod rewrite
 RewriteEngine On
 #the location of the root of your site
#if writing for subdirectories, you would enter /subdirectory
RewriteBase /barj

#Removes access to CodeIgniter 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]

#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

#This last condition enables access to the images and css
#folders, and the robots.txt file
RewriteCond $1 !^(index\.php|images|robots\.txt|css)

RewriteRule ^(.*)$ index.php?/$1 [L]

在config.php中,我有以下配置

代码语言:javascript
复制
$config['index_page'] = "";
$config['REQUEST_URI']  = "AUTO";

请给我任何想法来解决这个问题。

EN

回答 2

Stack Overflow用户

发布于 2012-06-02 14:38:59

请在appache配置文件中检查mod_rewrite模块是否启用。

您可以通过以下命令进行检查。

代码语言:javascript
复制
echo phpinfo();

如果未启用,请启用它。

票数 1
EN

Stack Overflow用户

发布于 2012-06-02 15:12:24

首先试一下这个最小的代码。它对我来说运行得很好。

代码语言:javascript
复制
# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10860364

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档