I have a reverse proxy for /
pointing to Wordpress on another domain. I want to edit and administer it via the other domain, but I don't want the contents to be publicly available, so there is no duplicate content penalties from Google. How can I set this up? I was thinking of adding
Add the following to your .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain$
RewriteRule ^(/)?$ blog [L]
But will that still allow the ability for administrators to access hidden.domain/wp-admin?
I have a reverse proxy for http://www.xxxx/guides/
pointing to Wordpress on another domain. I want to edit and administer it via the other domain, but I don't want the contents to be publicly available, so there is no duplicate content penalties from Google. How can I set this up? I was thinking of adding
Add the following to your .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?YourDomain$
RewriteRule ^(/)?$ blog [L]
But will that still allow the ability for administrators to access hidden.domain/wp-admin?
Share Improve this question edited Oct 16, 2015 at 19:04 Chloe asked Oct 1, 2015 at 5:09 ChloeChloe 2452 gold badges4 silver badges13 bronze badges1 Answer
Reset to default 1To 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$ [NC]
RewriteRule (.*) http://www.xxxx/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.
- IP Whitelisting via IPTables or similar solutions
- Restricting access from outside your network via VPN
- Changing the /wp-admin/ to something else to further obfuscate it
- 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$ [NC]
RewriteCond %{REQUEST_URI} ^/wp-admin
RewriteRule (.*) http://www.xxxx/guides/%{REQEUST_URI} [R=301,L]