How do I host WordPress on a hidden domain through a reverse proxy?

To ensure your content isn’t crawled from the hidden admin DOMAIN you could include something like this in your .htaccess file.

RewriteEngine On

#Force traffic to production URL
RewriteCond %{HTTP_HOST} !xxxx.com$ [NC]
RewriteRule (.*) http://www.xxxx.com/guides/%{REQEUST_URI} [R=301,L]

There is more than one way to handle this first redirect so your code may work too (didn’t test it personally). I have used this snippet with success in multiple projects though.

The next part of your question needs a bit of additional work / clarification.

Please be aware that just because /wp-admin/ is visible, doesn’t mean the content stored within that WP instance is accessible to the public or crawlable (the redirect above will handle standard web traffic)

That being said, there are several ways to restrict access to the /wp-admin/ area beyond basic WordPress credentials.

  1. IP Whitelisting via IPTables or similar solutions
  2. Restricting access from outside your network via VPN
  3. Changing the /wp-admin/ to something else to further obfuscate it
  4. Hardening your WP security with two-factor authentication, limited login attempts, anti brute-force measures, strong passwords, etc.

If items 1 or 2 are viable options you can extend your .htaccess to allow whitelisted traffic into the wp-admin area with something like this:

# block wp-admin traffic unless whitelisted
RewriteCond %{HTTP_HOST} !admin-domain.com$ [NC]
RewriteCond %{REQUEST_URI} ^/wp-admin
RewriteRule (.*) http://www.xxxx.com/guides/%{REQEUST_URI} [R=301,L]