0

ホストゲーターがホストするドメインで完全に動作する codeigniter アプリケーションがあります。

URL から index.php を削除するように .htaccess と config.php を構成しました。前述のように、これは 100% 機能しています。Afrihost を使用して、アプリケーションをホストゲーター サーバーから南アフリカのローカル サーバーに移動する必要があります。

変更された htaccess と構成ファイルを以下に示します。

私のhtaccessファイルは次のとおりです。

RewriteEngine on
RewriteBase /

# Prevent CI index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L] 

# Prevent user access to the CI system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L] 

# Prevent user access to the CI application folder
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

私のconfig.phpファイルは次のとおりです。

$config['base_url'] = 'http://logicoportal.co.za';
$config['index_page'] = '';
// let me know if you need to see any other setting

ドメインhttp://www.logicoportal.co.zaを参照しようとすると、エラーが発生しますThis page can't be displayed

自分のイオン認証コントローラー ( http://logicoportal.co.za/auth/login ) を参照すると、 404 エラーが発生しますThe webpage cannot be found

完全な codeigniter デフォルト パスhttp://logicoportal.co.za/index.php/auth/loginを参照すると、エラーが発生します。This page can't be displayed

htaccess 設定エラーだと思いますが、これを修正する方法がわかりません。運の悪い記事をたくさん読んでください。あるいは、これをサポートするために codeigniter に別の構成設定がありますか?

私は新しいホスティング会社である Afrihost と話しましたが、彼らはこの点に関しては助けられないと言っています.

アドバイス/指示をいただければ幸いです。

いつもありがとう。

4

2 に答える 2

4

作業ソリューション: 共有ホスティング サーバー上の index.php を削除するための htaccess ファイル

DirectoryIndex index.php
RewriteEngine on

RewriteCond %{REQUEST_URI} !^(index\.php|\.swf|forums|images|css|downloads|js|robots\.txt|favicon\.ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) ./index.php [L]
于 2013-03-06T06:48:03.600 に答える
1

を削除してみてください?:

RewriteRule ^(.*)$ /index.php?/$1

っていうことは:

RewriteRule ^(.*)$ /index.php/$1
于 2013-03-05T07:58:44.377 に答える