2011-08-16 12 views
3

CodeIgniterでは、URLの "local.wamp"上の "index.php"を削除します。例えば、http://localhost.com/ci/index.php/controller/functionCodeIgniter:WAMPのURLで "index.php"を削除する

http://localhost.com/ci/controller/functionに私は(index.phpのは、あるルートディレクトリに配置され、)

$config['index_page'] = 'index.php'; to $config['index_page'] = ''; 

私の.htaccessファイルを変更している次のとおりです。

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /igniter 

#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] 

#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 
#Submitted by Michael Radlmaier (mradlmaier) 
RewriteCond $1 !^(index\.php|images|robots\.txt|css) 
RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

<IfModule !mod_rewrite.c> 
# If we don’t have mod_rewrite installed, all 404’s 
# can be sent to index.php, and everything works as normal. 
# Submitted by: ElliotHaughin 

ErrorDocument 404 /index.php 
</IfModule> 

私もhttpd.confファイルに入って、コメントを外しましたLoadModule rewrite_module modules/mod_rewrite.so

最後に、httpd.confファイルのディレクトリセクションが見えますこのように..

<Directory /> 
    Options FollowSymLinks 
    AllowOverride All 
    Order deny,allow 
    Deny from all 
</Directory> 

そして、私はまだそれが仕事を得ることができない...ページは読む:「要求されたURL/DB /サイトは、このサーバー上に見つかりませんでした。」

ご協力いただきありがとうございます。

+3

たぶん、あなたは正しいです –

+0

'でRewriteBase /'!それを正しいディレクトリに設定するだけでした。ありがとう。 – Danny

+1

ダニー、アルフォンソがあなたの問題を解決した場合、あなたは彼の答えを受け入れる必要があるので、彼は彼の報酬を受けることができます。 – KyleFarris

答えて

5

試してみてください。

RewriteBase/

変更するには、ディレクトリ

+1

誰かがエイリアスを使用している場合、これは動作します:RewriteBase/aliasname – rostamiani

関連する問題