I have a CMS running on cms.com that handles login to all my customer. Currently my customers have to go to cms.com to access the panel.
I want them to access the same CMS using their own domains such as customerdomain.com/admin while keeping the urls.
So, a given request such as posts.php?id=1 which is accessed as cms.com/posts.php?id=1 should be accessed by customerdomain as customerdomain.com/admin/posts.php?id=1
RewriteEngine On
RewriteRule "^admin/(.*)$" "http://cms.com/$1" [P]
We have solved using A type DNS records. What we did was, for each client we created a subdomain (admin.sitename.com) and an A type record for the subdomain admin.sitename.com pointing to the CMS's server IP.