php - How to make nginx rewrite rules work? -


i want add rewrite rules this.

location / {      autoindex   on;      root   /users/guest/projects/demo/public;     index  index.php index.html index.htm;      location ~* ^/signin {         rewrite ^/signin(.*)$ /account/page/signin$1 break;     }        if (!-e $request_filename) {         rewrite ^/(.*)  /index.php?$1 last;     }    } 

i want works these steps long type url "http://host/signin".

step 1 : rewrite url "http://host/account/page/signin" step 2 : rewrite rule "rewrite ^/(.*) /index.php?$1 last;"

but now, step 1 working, seems rule stop @ there.

i tried different way do, such as

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

or

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

sometimes can error log :

open() "/users/guest/projects/demo/public/account/page/signin" failed (2: no such file or directory) 

how can make work want?


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -