私はこれを私の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を再起動しました]