I have multiples subdomains that I want to redirect in nginx or php like that
Example: test.test2.domain.com to domain.com/test/test2
It's possible to do a 301 Redirect in nginx so in php I can get the parts test and test2 as params ?
Thanks
I have multiples subdomains that I want to redirect in nginx or php like that
Example: test.test2.domain.com to domain.com/test/test2
It's possible to do a 301 Redirect in nginx so in php I can get the parts test and test2 as params ?
Thanks
Try this
server {
server_name test.test2.domain.com;
location / {
return 301 domain.com/test/test2;
}
}
Put this in your nginx configuration file
server {
listen *:80;
server_name test.test2.domain.com;
return 301 $scheme://domain.com/test/test2/$request_uri;
}