2012-03-05 10 views
0

通常、nginxのApacheで動作する内部フレームワークを使用しようとしています。私はhtaccessを変換する運がなかった。Apacheをnginx-htaccessに変換できません。変換しようとしません。

私はhttp://www.anilcetin.com/convert-apache-htaccess-to-nginx/を利用していません。私はそれから自分でやってみました(別のルールを思いついた)。でもそれはうまくいきません。

  index index.php; 

      location/{ 
        if (!-e $request_filename) { 
          rewrite ^(.*)$ /index.php?$1 last; 
          break; 
        } 
        rewrite ^/$ /? last; 
      } 

      location ~ ^/(assets|robots\.txt|favicon\.ico|license.txt) { 

      } 

      location ~ \.php$ { 
       fastcgi_pass unix:/var/run/php5-fpm.sock; 
       fastcgi_index index.php; 
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
       include fastcgi_params; 
      } 

私が変換しようとしているhtaccessファイルは、次のとおりです:ここで私は、現在持っているものだ

DirectoryIndex index.php 
RewriteEngine on 
RewriteBase/
RewriteCond $1 !^(index\.php|assets|robots\.txt|favicon\.ico|license.txt) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] 
RewriteCond %{QUERY_STRING} . 
RewriteRule ^$ /? [L] 

は誰が何を間違っているか、私は何をすべきかを知ることが起こるでしょうか?

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

答えて

0

Nginx設定では、ほとんどの場合、ifを使用しないでください。これを試してください

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

残りの部分は、長い醜い正規表現の場所ブロックが不要になるように、特定のファイルを書き換えていません。

関連する問題