Caio Tarifa
Caio Tarifa

Reputation: 6043

Nginx Rewrite Directory-only

I've the following rewrite into server {}:

rewrite ^/([^/]*)$ /Location.php?$1&$2&$3&$4&$5&$6&$7&$8&$9&$10;

My Location.php is inside the register folder. How I do to run this rule only when the visitor is in the register directory?

Upvotes: 1

Views: 189

Answers (1)

Mohammad AbuShady
Mohammad AbuShady

Reputation: 42799

Can't you simply add /register ? like

rewrite ^/register/([^/]*)$ /register/Location.php?$1&$2&$3&$4&$5&$6&$7&$8&$9&$10 break;

and how come Location.php is inside register folder yet you wrote /Location.php not /register/Location.php

Upvotes: 1

Related Questions