2011-12-06 9 views
-1

ローカルテストサーバー(XAMPP)で正しく動作しているCodeigniter 2.1のインストールがありますが、これをネットワークソリューションのホストのテストサブドメインに移動すると、.htaccessを取得できませんindex.phpを削除してください。私は「/のhtdocsに/テスト」および/テストとして書き換えパスを試してみましたが、私はまだ次のエラーを取得する:Codeigniter on Network Solutionsのmod_rewrite

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

<IfModule mod_rewrite.c> 
SetEnv APPLICATION_ENV development 
RewriteEngine On 
RewriteBase /test 

#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> 
# If we don't have mod_rewrite installed, all 404's 
# can be sent to index.php, and everything works as normal. 
# Submitted by: ElliotHaughin 

ErrorDocument 404 /index.php 
</IfModule> 

私のサブドメインは、/のhtdocsにで収納されている/テスト

ありがとうございました!

+0

'RewriteBase /'で試しましたか? – stealthyninja

+0

エラーログからメッセージを貼り付けることができますか? – Repox

答えて

0

問題はhttpd.confで発生する可能性が最も高いですが、自分で編集することができない場合は、ホストサポートに連絡することはあまりありません。あなたのホスト上であなたのApache設定を編集することができるなら、それを投稿して、あなたを助けることができます。

モジュールはロードされていますが、ディレクトリが書き換えられることを許可しない場合があります。これは、シンボリックリンクに従うことを特に許可しません。

0

まず、mod_rewriteモジュールをApacheにインストールしてください。 MAINのindex.phpファイルの先頭に、スクリプトを殺す:あなたはmod_rewriteが表示されない場合

<?php die(var_dump(apache_get_modules())); ?> 

どこでもそれがインストールされていません。それをインストールするには

、(あなたがアクセス権を持っている場合)、サーバーで次のコマンドを実行し、

sudo a2enmod rewrite 

その後、私のためのmod_rewriteを有効にし、それがうまく働きました。

ルートアクセス権がない場合は、カスタマーサポートに連絡して有効にする必要があるかどうかを確認する必要があります。