【问题标题】:htacess for root folder with wordpress install and subdirectory for another domainhtaccess 用于带有 wordpress 安装的根文件夹和另一个域的子目录
【发布时间】:2015-10-23 09:52:22
【问题描述】:

我在我的网站目录中安装了 wordpress,例如(public_html/wp-content、public_html/wp-admin、public_html/wp-includes),并且我有一个指向另一个域 public_html/anotherdomain.com 的子目录

我不希望另一个域搞乱根 wordpress 安装。 前任。 anotherdomain.com 应该只访问 public_html/anotherdomain.com,而 originaldomain.com 应该访问 public_html 文件夹,不包括 anotherdomain.com。

我的问题是最好的方法是什么?

  1. 使用 htaccess?
  2. 使用 cpanel 插件域并为 wordpress 安装创建一个子目录?

【问题讨论】:

    标签: wordpress apache .htaccess


    【解决方案1】:

    如果您使用 .htaccess,您可以阻止从您的 wordpress 站点访问 anotherdomain.com。这将起作用,但有点草率,并且对未来的计划并不好。当您获得更多域并安装它们时,您会继续这样做吗?

    更简洁的方法是我认为您在第 2 项中所说的内容。为 wordpress 网站提供自己的目录,该目录与 anotherdomain.com 是对等的。这样,如果您有 1、2 或 10 个域,它的工作方式相同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-11-24
      • 2012-01-10
      • 1970-01-01
      • 2011-09-17
      • 1970-01-01
      • 2013-06-20
      • 1970-01-01
      相关资源
      最近更新 更多