0

私はこれを私のhtaccessファイルに持っています

RewriteEngine On                             
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f            #do not process for real files
RewriteCond %{REQUEST_FILENAME} !-d            #do not process for real folder
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]      #rewrite

これをnginxconfファイルに追加しようとしました

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

私の中

server{...}

限られた成功でブロック、私は得る

http://example.com/about/contact.html > /index.php?q=/about/contact.html

それ以外の

http://example.com/about/contact.html > /index.php?q=about/contact.html

そして、マイナーではありますが、この先頭の/はMODxを壊しています。(ハッキングしての値を変更する場合でも$_GET['q']$_SERVER['QUERY_STRING']$_SERVER['REQUEST_URI'])

[はい、nginxを再起動しました]

4

1 に答える 1

1

MODx

MODxには、私のために機能するサンプルnginx confファイルを含むマニュアルページがあります。http://rtfm.modx.com/display/revolution20/Nginx+Server+Config

于 2013-02-13T09:11:33.977 に答える