0
私はnginxの書き換えをしようとしています。動作していますが、サブディレクトリの場合、個々のサブディレクトリ内のindex.phpではなく、ルートのindex.phpを使用しています。Nginxはサブディレクトリを書き換えます
/index.php
/p/index.php
/c/index.php
と、これは私のリライトです:
if (!-e $request_filename){
rewrite ^/([^./]+)/?$ /index.php?act=$1 break; #need break?
rewrite ^/([^./]+)/(.+)/?$ /index.php?act=$1&upm=$2 break;
rewrite ^/([^./]+)/([^./]+)/?$ /$1/index.php?act=$2;
}
が、私は、各サブディレクトリのエントリを追加しようとしたが、それはどちらか動作しません。
location /p/ {
root /home/user/public_html/p/;
rewrite ^/([^./]+)/(.+)/?$ /index.php?act=$1&upm=$2 break;
}
私のディレクトリ構造がどのように見えるかです
アイデア