最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp admin - How do I host Wordpress on a hidden domain through a reverse proxy?

programmeradmin1浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 1

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$ [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.

  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$ [NC]
RewriteCond %{REQUEST_URI} ^/wp-admin
RewriteRule (.*) http://www.xxxx/guides/%{REQEUST_URI} [R=301,L]
发布评论

评论列表(0)

  1. 暂无评论