url rewriting - Rewrite rule for the root file in nginx? -
i want redirect / different file rather index.php/.html.
so on apache can this..
rewritecond %{request_filename} -f rewriterule . /path/to/dir/index.html [l] trying in nginx doesn't run, seems:
if (-f $request_filename){ set $rule_0 1$rule_0; } if ($rule_0 = "1"){ rewrite /. /path/to/dir/index.html last; } also tried this:
if ($request_filename ~ "/index.php"){ set $rule_3 1$rule_3; } if ($args ~ "^$"){ set $rule_3 2$rule_3; } if ($rule_3 = "21"){ rewrite /. /wp-content/plugins/i-static/content/index.html last; } it acts doesn't exist , prints out index.php.
if want isolate single uri /, use location = variant. try:
location = / { rewrite ^ /new/index.html last; } this perform internal rewrite. see this document details.
Comments
Post a Comment