-1

I'm trying to spoof file location by sending long url to the server, the server translate it to the proper php file and return the result, example:

I send a link like this:

http://example.com/fakelocation/123/456/789

I want the server to translate it like this:

http://example.com/myfile.php?arg=123&arg2=456&arg3=789

I have tried for several hours with no luck, also the third arg should be optional.

Thanks!

Cyb3r
  • 17
  • 4

1 Answers1

1

I got it working like this:

rewrite ^/fakelocation/(\w*)/(\w*)/(\w*)? /myfile.php?arg1=$1&arg2=$2&arg3=$3 last;
Cyb3r
  • 17
  • 4