我的web应用程序在URL中没有index.php就不能工作。它已经在我之前的笔记本电脑(OS: Ubuntu 10.10)上运行了。在我的新笔记本电脑上,在Fedora 16操作系统下,它不能工作。我做了所有的检查,像.htaccess,cofig.php等等。其他的应用程序而不是像PHPMyAdmin这样的CodeIgniter框架工作得很好。以下是我的.htaccess代码。
# 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中,我有以下配置
$config['index_page'] = "";
$config['REQUEST_URI'] = "AUTO";请给我任何想法来解决这个问题。
发布于 2012-06-02 14:38:59
请在appache配置文件中检查mod_rewrite模块是否启用。
您可以通过以下命令进行检查。
echo phpinfo();如果未启用,请启用它。
发布于 2012-06-02 15:12:24
首先试一下这个最小的代码。它对我来说运行得很好。
# 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>https://stackoverflow.com/questions/10860364
复制相似问题