0

共有ホスティング アカウントで CodeIgniter を動作させるのに問題があります。URL はhttp://test.tallgreentree.comです。.php エラーは表示されませんが、アドレス バーに入力したすべてに対して 404 ページが表示されます。

これが私のconfig.phpファイルの始まりです。

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
|   http://example.com/
|
*/
$config['base_url'] = "http://test.tallgreentree.com/";

/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = "index.php";

/*
|--------------------------------------------------------------------------
| 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";

サブドメインで CodeIgniter を使用する場合の既知の問題はありますか? 何が原因でしょうか? 複数の構成を試しましたが、何も機能していないようです。ホスティング プロバイダーに確認する必要があるサーバー設定は何ですか?

お時間をいただき、ご協力いただきありがとうございました。

4

3 に答える 3

1

変化する

$config['uri_protocol'] = "AUTO";

$config['uri_protocol'] = "REQUEST_URI"

それが修正されるかどうかを確認します

また、クラスコントローラー名はファイル名と同じですか?

ファイル名 = test.php

class Test ...
于 2009-02-19T18:51:32.627 に答える
0

「REQUEST_URI」でこれを機能させましたが、ホームページしかヒットできません。(コントローラーへの) 他のすべてのリンクは、常にホームページに更新されます。正しい URL が表示されているのに、どの URL をクリックしてもホームページに移動するというのはちょっと奇妙です。

何か案は?私は.htaccessファイルを持っていますが、

RewriteBase の RewriteEngine /testci RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(. )$ /index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(. ) $ index.php/$1 [L] RewriteCond $1 !^(index.php|images|captcha|css|js|robots.txt) addType text/css .css

于 2009-09-23T18:10:47.497 に答える
0

config.php ファイルに 2 つの変更を加える

最初のものは次のとおりです。

   `$config['uri_protocol'] = "AUTO";`

   `$config['uri_protocol'] = "REQUEST_URI"`

2 つ目は次のとおりです。

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

    $config['index_page'] = 'index.php?';
于 2014-04-22T06:58:01.277 に答える