2011-02-11 7 views
0

を動作していない、と私は私のウェブサイトURIが「index.phpを」部分のないCI 2.0コントローラ/機能へのアクセスは、私はCIを使用してウェブサイトを構築してい

http://myweb.com/controller/function 

としてきれいになりたいです。

私はCI 1.73でこれを行うことに成功していますが、私はそれは私がすることroute.php設定したCI 2.0
での作業を取得することはできません。

$route['default_controller'] = 'home'; 

とのconfig.php

$config['index_page'] = ''; 

私も使用して、私の裁判で働いていた.htaccessファイルを入れているCI 1.73

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /myweb 

#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 $1 !^(index\.php|images|captcha|css|js|robots\.txt) 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 

提案がありますか?

+0

はあなただけ「のdoesntの仕事」、ないようにしようと何実際に起こっているかと言うことを忘れないでください。 –

答えて

2

私はこの行がRewriteBase /mywebが原因だと言いたいと思います。代わりにRewriteBase /を入力してください。

<IfModule mod_rewrite.c> 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

注私はあなたがindex.phpの後だけ/を置くべきだと思う、ではない:あなたは、それが動作するように、このような何かを得るまで

また、私は最大であなたの.htaccessを簡素化しようとするだろうそのような?/

RewriteRule ^(.*)$ index.php/$1 [L] 
関連する問題