问答详情
源自:3-9 初始化运行参数

请问nginx rewrite 应该怎么写呢?

请问nginx rewrite 应该怎么写呢?

提问者:alexkuang 2017-07-25 18:46

个回答

  • 猪仔SAM
    2018-07-18 14:24:09

    if (!-f $request_filename){

    set $rule_0 1$rule_0;

    }

    if (!-d $request_filename){

    set $rule_0 2$rule_0;

    }

    if ($rule_0 = "21"){

    rewrite /. /index.php;

    }


  • heshiwei
    2017-07-26 07:16:33

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


    本人亲测