17
I have a rewrite in NGINX or Apache for this address:
http://example.com/hello
to a script like
http://example.com/test.php&ref=hell
How can I access this rewritten URL in PHP? Because, if I use $_SERVER['REQUEST_URI'] of course I get:
/test.php&ref=hell
but I only want:
/hello
Is this possible? The following is the content of my NGINX configuration file:
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
server
{
listen 80;
server_name example.com;
location /
{
rewrite ^/(main|best|air)$ /core/feeds.php?act=$1 last;
proxy_pass http://127.0.0.1:8080;
}
}