6

サブディレクトリwww.siteb.com/rexonaにCIをインストールしました

www.siteb.com/rexona 内の私の .htaccess :

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /rexona

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

ErrorDocument 404 /index.php
</IfModule>

config.php で:

$config['index_page'] = '';
$config['base_url'] = '';
$config['uri_protocol'] = 'AUTO';

コントローラーにアクセスしようとするたびに、No input file specifiedが表示されます。ただし、デフォルトのコントローラーはロードされますが、デフォルトのコントローラーのメソッドにもアクセスできません。

何かご意見は?ありがとう。

4

4 に答える 4

24

uri_protocol何かに設定する必要があります-少なくともautoに設定してください。

エラーが発生するのは、PHP が CGI として実行されるためです。これは、代わりに URL 書き換えを渡す必要があることを意味しますindex.php?/$1(疑問符に注意してください)。

于 2012-04-28T08:44:20.380 に答える
1

あなた$config['uri_protocol']は空であってはなりません。デフォルトはですAUTO。空の文字列を渡すと、Routerクラスを介してリクエストをルーティングするために使用されるコアURIクラスが壊れます。

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
|--------------------------------------------------------------------------
|
| This item determines which server global should be used to retrieve the
| URI string.  The default setting of 'AUTO' works for most servers.
| If your links do not seem to work, try one of the other delicious flavors:
|
| 'AUTO'            Default - auto detects
| 'PATH_INFO'       Uses the PATH_INFO
| 'QUERY_STRING'    Uses the QUERY_STRING
| 'REQUEST_URI'     Uses the REQUEST_URI
| 'ORIG_PATH_INFO'  Uses the ORIG_PATH_INFO
|
*/
$config['uri_protocol'] = 'AUTO';

コメントが言うように:「あなたのリンクがうまくいかないようなら、他のおいしいフレーバーの1つを試してください」。空の文字列はそれらのフレーバーの1つではなく、通常は空になる
から読み取ろうとすることになります。$_SERVER['']

于 2012-04-28T08:11:41.943 に答える
0

Hostinger の無料アカウントでも同じエラーが発生します。上記の jhon foo によって提示された問題を解決してください。

私の.htaccess

RewriteBase /MY_SUBFOLDER_UNDER_HTML_DIRECTORY/
RewriteEngine on

RewriteBase /mY_subfolder/
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$0 [QSA,L]

これはうまくいきます、どうもありがとう!

于 2015-09-22T02:26:18.503 に答える