I’m building a SAAS product with PHP/HTML on shared hosting on a Linux server and I’m stuck on the domain name part.
Goals
I would host my SAAS app on app.mysaas. com
My customers point their domain name to app.mysaas. com
- www.customer01. com
- www.customer02. com
- www.customer03. com
- etc…
Any visitors on the customer’s domain should be served content from app.mysaas. com
without them noticing, meaning they see www.customer01. com
in their browser.
Also when visiting www.customer01. com/contact they should be served content from app.mysaas. com/contact/ without them noticing, meaning they see www.customer01. com /contact/ in their browser.
SEO on the customer’s domain should not be affected as read in the article https://smartclick.mk/seo-for-saas-and-best-optimising-practices/. So via iframe isn’t an option.
I would need my customer to provide an API key. I thought I let my customer add a TXT record to their DNS containing their API key and pick it up with PHP on my server.
Questions
- Should they point their domain via DNS using an A record or a CNAME record? (Their e-mail setup should not be affected.)
- How do I detect the customer’s domain pointing to
app.mysaas.com
? (I thought with PHP’s var$_SERVER['HTTP_HOST']
) - If I’m way off, could you provide a step by step guide please?
- Are there any good online tutorials ?
Thank you for you time.