2016-03-30 4 views
3

当社のサードパーティプロバイダーは、codeigniterサイト内にcodeigniterサイトを作成しました。コードnginxでネゲートされたアプリケーションに対して404エラーを出すイグナイター

これは、以下の意味:

1:我々はCIのケースフォルダに標準のアプリケーションフォルダを持っています。

2:内部には、CIベースフォルダのコピーである管理者フォルダがあります。 CIの名前を 'admin'に変更して、コードイグナイターの中でcodeigniterをコピーしている人と考えてください。

当社nginx.confは以下の通りです:

worker_processes auto; 
worker_rlimit_nofile 1035; 
pid /usr/local/var/run/nginx.pid; 


events { 
     worker_connections 1024; 
     multi_accept on; 
     use kqueue; 
} 

http { 

     include mime.types; 

     server{ 
       listen 80; 
       server_name localhost ; 

       access_log /usr/local/etc/nginx/logs/default.access.log ; 
       error_log /usr/local/etc/nginx/logs/default.error.log ; 

       #root /Users/rishi/appiness/rishijfh; 
       root /Users/rishi/appiness/JobsForHer-PHP; 

       index index.php index.html; 

       location/{ 
         try_files $uri $uri/ /index.php?args; 
       } 

       location ~ \.php$ { 
         include fastcgi_params; 
         include fastcgi.conf; 
         fastcgi_pass 127.0.0.1:9000; 
       } 




} 

CI /アプリケーションフォルダの.htaccessファイルは、コンテンツの下にあります

<IfModule mod_rewrite.c> 
     RewriteEngine on 
     RewriteCond $1 !^(index\.php|images|robots\.txt) 
     RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

CI /管理/アプリケーションフォルダの.htaccessファイルは、以下の持っています内容:

<IfModule mod_rewrite.c> 
     RewriteEngine on 
     RewriteCond $1 !^(index\.php|images|robots\.txt) 
     RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 

CI /アプリケーションは正常に動作しますが、CI/admin/applicationは404エラーをスローします。

私はたくさん検索し、私たちのために働いてソリューションの https://www.quora.com/How-do-I-solve-CodeIgniters-404-not-found-error http://www.arifulhaque.com/codeigniter-htaccess-and-index-php-issues-solution/

なしの下に試してみました。助けてください。

答えて

0

これは、「外部」のCIがブラウザにアクセスするのではなく、管理者を管理者として参照しようとしていることが原因である可能性があります。

右の実際の書き換えの前に(ないアプリケーションフォルダが、ルートで)「外側」CIにおけるこれらの書き換え条件を試してみてください。

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

それは、この(ここではコピーされた鉱山)のようになります。

<IfModule mod_rewrite.c> 

    RewriteEngine On 

    # Removes trailing slashes (prevents SEO duplicate content issues) 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_METHOD} !POST 
    RewriteRule ^(.+)/$ $1 [L,R=301] 

    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

</IfModule> 

<IfModule !mod_rewrite.c> 

    ErrorDocument 404 /index.php 

</IfModule>