CodeIgniterでは、問題をインストールします。
-
05-09-2019 - |
質問
私は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を使用した場合の既知の問題はありますか?何が原因だろうか?私は、複数の設定を試してみたが、何も私のために働いているように見えるん。どのようなサーバーの設定私は私のホスティングプロバイダに確認する必要がありますか?
あなたの時間と支援ありがとうございました。
解決
変更
$config['uri_protocol'] = "AUTO";
タグに
$config['uri_protocol'] = "REQUEST_URI"
それはそれを修正する場合は、と参照
また、ファイル名と同じクラスのコントローラ名を持っていますか?
ファイル名= test.phpを
class Test ...
他のヒント
config.phpファイルでの2つの変更を行います。
最初のものはあります:
`$config['uri_protocol'] = "AUTO";`
タグに
`$config['uri_protocol'] = "REQUEST_URI"`
2つ目は、次のとおりです。
$config['index_page'] = 'index.php';
タグに
$config['index_page'] = 'index.php?';
私は、この「REQUEST_URI」と協力しましたが、その後、私は私のホームページを打つことができます。 (コントローラに)他のすべてのリンクは、必ずトップページに更新されます。それは正しいURLが表示されていることを一種の奇妙だが、関係なく、あなたがクリックするどのようなURLのホームページが表示されますない。
任意のアイデア?私は.htaccessファイルを持っている、
RewriteEngineに でRewriteBase / testci するRewriteCond%{REQUEST_URI} ^システム。* するRewriteRule ^(。の)$ /index.php/$1 [L] するRewriteCond%{REQUEST_FILENAME}!-f するRewriteCond%{REQUEST_FILENAME}!-d するRewriteRule ^(。の)$ index.phpを/ $ 1 [L] RewriteCond $ 1-4(index.phpの|画像|キャプチャ| CSS | JS | robots.txtの)! AddTypeのテキスト/ CSSの.css