Welcome! Log In Create A New Profile

Advanced

insert subdomain into query

December 29, 2013 03:26PM
I have setup a wildcard subdomain server(many subdomains)
server {
listen 80;
server_name ~(?<subdomain>.*).localhost;
...
...
}

I want to make the subdomain apart of the query in the backend

when we visit http://clothes.localhost/
backend query
http://localhost/script.php?sd=clothes

or we visit http://jackets.localhost/large/blue/
backend query
http://localhost/script.php?sd=jackets&size=large&colour=blue

I have tried for 5 hours now, Modifying rewrite and return as many ways possible, Multiple errors such as

rewrite ^ http://$subdomain.localhost/script.php?x=$subdomain permanent;

http://clothes.localhost/script.php/script.php/script.php/script.php/script.php/script.php/script.php/script.php/?sd=clothes?sd=clothes&sd=clothes?sd=clothes&sd=clothes?sd=clothes&sd=clothes?sd=clothes&
or
http://localhost/localhost/localhost/localhost/localhost

etc etc(I have tried many more tweaks but didnt record all as I went along)

Thanks in advance for any intention to help or answers given.
Subject Author Posted

insert subdomain into query

NginxNewComer December 29, 2013 03:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 291
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready