Search code examples
apache.htaccesshttp-redirectdnssubdomain

Create beta subdomain to my main site with these parameters below


I want to redirect (beta.mysite.com) subdomain, which is on another server (I only changed the DNS A record) to my main domain site, but would like to send with parameters like mysite.com?beta=1, and keep the subdomain url like beta.mysite.com.

On the main site I'd like to check the url (with get method) and if it's equal with my conditions I'd change the content with PHP.

Is this possible to do?

Thanks in advance!


Solution

  • You will require a reverse proxy server to do that. Which you can setup on beta.mysite.com and perform the proxy request with additional params.

    You can use any of the reverse proxy servers . eg. HAPROXY, nginx etc.