Nginx Rewrite Not rewriting the url -
i have tried hours , can't seem it. copied other examples , still can't rewrite work. need url on nginx http://myurl.com/main/login, http://myurl.com/somethigelse/home, est. appreciated. i'm new nginx, seems lot faster.
my nginx rewrite looks this:
rewrite ^/([^/]+)/([^/]+)$ /index.php?db=$1&action=$2 last; rewrite ^/([^/]+)/([^/]+)/$ /index.php?db=$1&action=$2 last;
it works me. tell nginx reload configuration (do sudo service nginx reload
)? otherwise, nginx still using old config.
note, can use 1 line making final slash optional using question mark:
rewrite ^/([^/]+)/([^/]+)/?$ /index.php?db=$1&action=$2 last; # ^
Comments
Post a Comment