如何在不同的子域上运行 WordPress 管理员?

发布于 2024-09-12 09:59:25 字数 1052 浏览 5 评论 0 原文

我需要通过 https 运行 WordPress 管理员。 我们使用 CDN 为站点提供缓存内容,但 CDN 无法接受安全流量(每个 IP 只允许一个 SSL 证书,并且我们在其上运行多个站点)。我无法控制 httpS://www.mysite.com/. 的重定向。

我想要:

http://www.mysite.com/blog/
httpS://secure.mysite.com/blog/wp-admin/
httpS://secure.mysite.com/blog/wp-login.php

我已尝试按照文章 http://codex.wordpress.org/Administration_Over_SSL#Virtual_Hosts

假设,您可以使用具有不同名称的主机,例如 wpadmin.mysite.com

不幸的是,按照建议尝试此操作仍然会将我发送到 httpS://www.mysite.com/blog/login.php

# No matter what it redirects to the wrong subdomain for login.php
http://www.mysite.com/blog/wp-admin/
-> httpS://secure.mysite.com/blog/wp-admin/
-> httpS://www.mysite.com/blog/wp-login.php.

此外,当直接转到 css 文件时,仍然链接到错误的 url (.)。

简单的解决方案是运行博客 http://blog.mysite.com/blog/。不幸的是,这已经被尝试过,但由于 SEO 原因而被拒绝。

Wordpress 有办法做到这一点吗?

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 per IP allowed, and we run several sites off it). I cannot control redirects for httpS://www.mysite.com/.

I would like to have:

http://www.mysite.com/blog/
httpS://secure.mysite.com/blog/wp-admin/
httpS://secure.mysite.com/blog/wp-login.php

I have tried rewriting the urls as suggested in the article http://codex.wordpress.org/Administration_Over_SSL#Virtual_Hosts.

Hypothetically, you could use a host with a different name, such as wpadmin.mysite.com

Unfortunately trying this as suggested still sends me to httpS://www.mysite.com/blog/login.php.

# No matter what it redirects to the wrong subdomain for login.php
http://www.mysite.com/blog/wp-admin/
-> httpS://secure.mysite.com/blog/wp-admin/
-> httpS://www.mysite.com/blog/wp-login.php.

Also when directly going to the css files still link to the wrong url (.)

The simple solution would have been to run the blog off http://blog.mysite.com/blog/. Unfortunately this has been tried and was decided against for SEO reasons.

Is there anyway Wordpress can do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

阪姬 2024-09-19 09:59:25

您是否研究过这个帖子?它是 WordPress HTTPS 插件的 mod。

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

失与倦" 2024-09-19 09:59:25

不太确定您是否看过这篇文章,但它在涉及基于 SSL 的 WordPress 管理时非常全面。向下滚动到有关虚拟主机的部分,其中有有关将 wp-admin 设置为子域的信息。

http://codex.wordpress.org/Administration_Over_SSL

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

不可一世的女人 2024-09-19 09:59:25

如果您使用 Apache 通过 SSL 提供服务,请查看 mod_proxy

使用它,您可以透明地将所有请求从 https://secure.mysite.com/blog/ 重定向到 http://www.mysite.com/blog/

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/.

迷路的信 2024-09-19 09:59:25

插件 http://wordpress.org/extend/plugins/admin-ssl- secure-admin/ 正是我所追求的。

不幸的是它在较新的 WordPress 版本上被破坏了:(

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

Unfortunately its broken on newer Wordpress versions :(

旧梦荧光笔 2024-09-19 09:59:25

通过 http://blog.example.com 的管理员访问权限.example.com/wp-admins/blog/wp-login.php" rel="nofollow">https://ssl.example.com/wp-admins/blog/wp-login.php 与纯Apache 配置,因此您不依赖于 Wordpress 插件和更新,您可能想要...

...在 HTTPS apache 虚拟主机上使用 mod_proxy 来转发流量,确保 ProxyPreserveHost 处于关闭状态,以便将代理语句中的主机名发送到WordPress 服务器。然后使用 mod_substitute (确保将其打开)来修复从 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/

为了使反向代理正常工作,您需要指定托管 blog.example.com 的服务器的内部 IP。即使上游服务器 (10.0.0.4) 有多个基于名称的虚拟主机,此解决方案也能确保该功能正常工作。

10.0.0.4 blog.example.com

有关更多详细信息,请参阅:

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

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文