We have a simple php based redirection application.
Here's an example:
spiderman.com/redirection/redirect-to-marvel/
The php script is in the "redirection" folder and let's say it will redirect the above link to marvel.com
NOW...
What if I want to create a totally different subdomain called try.superman.com which redirects using a CNAME to spiderman.com/redirection/ so that if I open this url:
try.superman.com/redirect-to-marvel/ it will actually forward to spiderman.com/redirection/redirect-to-marvel/ which will of course forward it to marvel.com
In short, the browser will show try.superman.com/redirect-to-marvel/ (due to the CNAME), but how do I, at the server end detect the incoming request from a CNAME record, and route it to the correct local folder?
Just need some direction here...
PHP's dns_get_record + htaccess the right direction?