I have dynamic laravel application, after registration user get it's own subdomain example.myapp.com and that's fine, now the agency develops marketing website which we would like to place on main domain: myapp.com.
What I tried:
I tried to play around with A record but that doesn't worked.
The possibility would be of course to load everything with
curlbut then that's not SEO friendly because the page would need to be hosted on a subdomain as well.
I would solve this issue by using a reverse proxy (NGINX for example).
Note that this is only a pseudo example!
In the above configuration:
Make sure to replace example.com with your actual domain name, subdomain_backend_server with the URL of the backend server for subdomains, and no_subdomain_backend_server with the URL of the backend server for URLs without a subdomain. Adjust the configuration as needed for SSL/TLS or any other specific requirements.
Hope this helps you on the way!
All the best.