How to run Wordpress admin on a different subdomain?

后端 未结 5 1892
刺人心
刺人心 2021-02-14 10:55

I have the requirement of running the Wordpress admin over https. We use a cdn to deliver cached content for the site but the cdn cannot accept secure traffic (only one SSL cert

相关标签:
5条回答
  • 2021-02-14 11:44

    Not too sure if you have seen this article but it's pretty comprehensive when it comes to Wordpress Admin over SSL. Scroll down to the part about Virtual Hosts, and there is information there about setting up the wp-admin as a subdomain.

    http://codex.wordpress.org/Administration_Over_SSL

    0 讨论(0)
  • 2021-02-14 11:45

    Have you looked into this thread? It is a mod on the WordPress HTTPS plugin.

    0 讨论(0)
  • 2021-02-14 11:52

    To enable admin access for http://blog.example.com through https://ssl.example.com/wp-admins/blog/wp-login.php with pure Apache config so you have no dependence on Wordpress plugins and updates you may want to...

    ...use mod_proxy on an HTTPS apache virtual host to forward traffic, ensure ProxyPreserveHost is Off so that host names in the proxy statements are sent through to the wordpress server. Then mod_substitute is used (make sure to turn it on) to fix the broken links coming back from wordpress.

    <Location /wp-admins/blog/>
    
      AddOutputFilterByType SUBSTITUTE text/html
      AddOutputFilterByType SUBSTITUTE text/css
      AddOutputFilterByType SUBSTITUTE application/javascript
      AddOutputFilterByType SUBSTITUTE application/json
      Substitute "s|http://blog.example.com|https://ssl.example.com/wp-admins/blog|i"
      Substitute "s|blog.example.com\\\/|blog.example.com\\/wp-admins\\/blog\\/|i"
      Substitute "s|'/wp-admin|'/wp-admins/blog/wp-admin|i"
      Substitute "s|\"/wp-admin|\"/wp-admins/blog/wp-admin|i"
      Substitute "s|'/wp-includes|'/wp-admins/blog/wp-includes|i"
      ProxyPassReverseCookiePath / /wp-admins/blog/
    
    </Location>
    
    ProxyPass /wp-admins/blog/ http://blog.example.com/
    ProxyPassReverse /wp-admins/blog/ http://blog.example.com/
    

    For the reverse proxy to work, you need to specify the internal IP of the server hosting blog.example.com. This solution ensures this will work even if the upstream server (10.0.0.4) has several name-based virtual hosts.

    10.0.0.4 blog.example.com
    

    For more details, see:

    http://tec.libertar.se/how-to-host-wordpress-admin-on-a-seperate-domain-and-subfolder/

    0 讨论(0)
  • 2021-02-14 11:53

    The plugin http://wordpress.org/extend/plugins/admin-ssl-secure-admin/ is exactly what I was after.

    Unfortunately its broken on newer Wordpress versions :(

    0 讨论(0)
  • 2021-02-14 12:01

    If you're using Apache to serve over SSL, look into mod_proxy.

    Using it you can transparently redirect all requests from https://secure.mysite.com/blog/ to http://www.mysite.com/blog/.

    0 讨论(0)
提交回复
热议问题