【问题标题】:Is there a WordPress plugin to manage subdomain URL mappings in WordPress?是否有 WordPress 插件来管理 WordPress 中的子域 URL 映射?
【发布时间】:2015-04-21 15:07:48
【问题描述】:

我在 cPanel 中有一个子域设置,例如 example.domain.com,并重定向到 domain.com/blah/file

这可行,但当然 URL 会更改为目标 URL,并且不会粘在子域上。它不会导航到任何地方,因为它指向一个控股/活动页面,但不确定如何让它留在子域名上,但拉入我想要的 URL。

是否有 WordPress 插件可以帮助解决这个问题,以便在管理员中创建这些活动时进行管理,或者在 cPanel 中进行管理?

【问题讨论】:

标签: php wordpress .htaccess dns subdomain


【解决方案1】:

Disable the redirectionpoint the subdomain to the main document root 并编辑主目录根目录中的 .htaccess 以包括:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub.domain.com
RewriteRule ^(.*)$ http://domain.com/subdomains/sub/$1 [L,NC,QSA]

归功于@Ansari's answer

【讨论】:

  • 我会把它放在主站点根目录中吗? domain.com/ 一个?
  • @James,是的,将子域指向主文档根目录。显然,您需要将sub.domain.com 更改为您的子域,并将http://domain.com/subdomains/sub/ 更改为您进入子域时想要显示的目录。
  • 我还应该在 cpanel 中删除子域和重定向吗?
  • 超级我会试一试,让你知道进展如何。谢谢你的帮助,我现在去看看。
猜你喜欢
  • 2018-09-21
  • 1970-01-01
  • 2013-01-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-09-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多