Custome
Custome

Reputation: 31

Nginx / php query string

So i have a url like this to display images on some html this is how it works right now

subdomain.example.com/?img=foo.png

I was wondering if it was possible to hide the ?img= part of the url so the url would look something like this

subdomain.example.com/foo.png

And still make the page show the html and css i have in my code

Upvotes: 3

Views: 91

Answers (1)

SuddenHead
SuddenHead

Reputation: 1503

Use rewrite:

rewrite ^/(.*) /?img=$1 last;

Upvotes: 1

Related Questions