0

私のWebアプリケーションは、URLにindex.phpがないと機能しません。以前のラップトップ(OS:Ubuntu 10.10)で動作していました。私の新しいラップトップでは、OSFedora16では機能しません。.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には、次のconfがあります

$config['index_page'] = "";
$config['REQUEST_URI']  = "AUTO";

問題を解決するためのアイデアを教えてください。

4

2 に答える 2

1

mod_rewriteモジュールが有効になっているかどうかをappache構成ファイルで確認してください。

次のコマンドで確認できます。

echo phpinfo();

有効になっていない場合は、有効にします。

于 2012-06-02T06:38:59.113 に答える
0

まず、この最小限のコードを試してください。それは私にとってはうまくいっています。

# 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>
于 2012-06-02T07:12:24.430 に答える