2013-07-13 11 views
5

Codeigniterはローカルサーバーでは正常に動作していますが、Webサーバーでは正常に動作しています。codeigniterはローカルでは問題なく動作しますが、Webサーバーではうまく動作しません。 404エラー

ローカルでの開発にはXAMPPを使用しました。

Microsoft Windows用のParallels Plesk Panel 11.0.9を使用しています。

404 codeigniterのエラーページがロードされていません。 URLはサーバーのloadind 404エラーページです。私はすべてを削除しました.htaccesルートディレクトリの書き換えルールは、index.phpを含んでいます。 まだ動作していません。

はたくさん検索されますが、適切なソリューションにCodeIgniterのフォルダ(サイト、アプリケーション、システム)

個人用サイト/をhttpdocs /デモで

mysite/httpdocs/demo/test/ 

ベースURLであるため

Directoryを見つけることができませんでした/test/application/config/config.php

$config['base_url'] = 'http://mysite/httpdocs/demo/test/site/'; 
Envoirmentはindex.phpを(のindex.php 個人用サイト/をhttpdocs /デモ/試験/サイト/)に設定個人用サイト/をhttpdocs /デモ/試験/アプリケーションにおいて

/.htaccessの

Deny from all 

個人用サイト/をhttpdocs /デモ/テスト/サイトで
switch (dirname(__FILE__)) { 
     case 'http://mysite/httpdocs/demo/test/site': 
      define('ENVIRONMENT', 'development'); 
     break; 

     default: 
      define('ENVIRONMENT', 'production'); 
     break; 
    } 
      $system_path = '../system'; 
      $application_folder = '../application'; 

/.htaccessの

   <IfModule mod_rewrite.c> 
          Options +FollowSymLinks 
          RewriteEngine on 
          RewriteCond %{REQUEST_FILENAME} !-f 
         RewriteCond %{REQUEST_FILENAME} !-d 
          RewriteRule ^(.*)$ index.php/$1 [L] 
       </IfModule> 
私は、URL 個人用サイト/デモ/テスト/サイトにウェブのその与えて404エラーページを与えている個人用サイト/をhttpdocs /デモ/テスト/アプリケーション/設定/ routes.phpの

  $route['default_controller'] = "page"; 
      $route['404_override'] = 'page'; 
      $route['article/(:num)/(:any)'] = 'article/index/$1/$2'; 

サーバーはコードシニターではありません

ここで私は間違っていますか?

+0

'index.php'を含むサイトにアクセスできますか?例えば'mysite/demo/test/site/index.php' –

+0

いいえ、私もそれを試しました。 – Kits

+0

'$ config ['base_url'] = ''を試してください – Shomz

答えて

10

私は自分のホストに連絡しました。彼らは、PHPハンドラに問題があると言いました。 web.configファイルの

これ以外IISから個人用サイト/をhttpdocs /デモ/テスト/サイトで、私は、ファイルweb.configを作り、.htaccessで置き換える代わりに、.htaccessファイルを読み取れません/

コンテンツは

です
<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 

<system.webServer> 

    <httpErrors errorMode="Detailed" /> 
    <asp scriptErrorSentToBrowser="true"/> 

    <rewrite> 
    <rules> 
     <rule name="RuleRemoveIndex" stopProcessing="true"> 
      <match url="^(.*)$" ignoreCase="false" /> 
      <conditions> 
       <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> 
       <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> 
      </conditions> 
      <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true"/> 
     </rule> 
    </rules> 
    </rewrite> 

</system.webServer> 

<system.web> 
    <customErrors mode="Off"/> 
    <compilation debug="true"/> 
</system.web> 

</configuration> 

ウェブサイトが起動しています。 のサポートありがとうございます。

+0

ありがとうございました。それは私のために働いた –

+0

私は私の一日を無駄にし、最終的にソリューションを見つける、ありがとう。 – developersaumya

0

私はまだコメントできませんので、私は答えに行きます。

あなたが.htaccessファイルを持っている場合は、プロジェクトのルートディレクトリを確認し、サーバーへのアクセス権を持っている場合mod_rewrite(Apacheを使用していると仮定)が有効になっている場合だけでなく、あまりにもチェックすることがあります。これはURL書き換えの問題かもしれません。

EDIT 1

[OK]を、今私はあなたがそこに.htaccessファイルを持っている参照してください。 httpdの<Directory>の指令はどうでしょうか?confか、これは<VirtualHost>で設定しますか?

EDIT 2

は、これであなたの.htaccessを変更してみてください:

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/

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

    #When your application folder isn't in the system folder 
    #This snippet prevents user access to the application folder 
    #Submitted by: Fabdrol 
    #Rename 'application' to your applications folder name. 
    RewriteCond %{REQUEST_URI} ^application.* 
    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 
    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> 
+0

私はそれに触れていませんでした。単純にcodeigniterのウェブサイトを作成してWebサーバーにアップロードし、** Parallels Plesk Panel ** – Kits

+0

を使用しています。 – Kits

+0

Parallels Plesk Panelを実際に使用した経験はありませんが、間違っているようですここに。これを見てください: 'http:// mysite/httpdocs/demo/test/site'というURLはURLであってはなりません。このプロジェクトのあなたのドメイン名は何ですか?地元ではうまくいくかもしれませんが、ライブではありません。 – dqlopez

関連する問題