【发布时间】:2020-07-28 03:07:28
【问题描述】:
我们有一个 Wordpress 多站点安装,每个站点都有自己的域:
很棒的训练
想不通
感知分析
在 htdocs 文件夹中,我们有一个子文件夹,其中包含我们用于其中一个站点的资产,该文件夹名为 /Aj-Isle/,非 wordpress 资产应用于 https://fantastic-training.com/ 站点。
但是,该文件夹对所有 3 个域都可用,这是我们不希望的行为。因此,尝试查看所有 3 个域中的文件 DOMAIN/Aj-Isle/south.png 是可行的。
https://fantastic-training.com/Aj-Isle/south.png
https://fantastic-thinking.com/Aj-Isle/south.png
https://perceptionprofiling.com/Aj-Isle/south.png
有谁知道我们如何使用 htdocs 文件夹中的 .htaccess 文件来限制它,以便 Aj-Isle 文件夹仅在请求 https://fantastic-training.com/ 域时可用?
我认为这与 HTTP_HOST 变量有关?
基本上我知道在英语中我想创建的规则是这些......
如果您是/Aj-Isle/ 入站且未请求https://fantastic-training.com/Aj-Isle/,则重定向到目标域的根目录
如果您是/limesurvey/ 入站且未请求https://perceceptionprofiling.com/limesurvey/,则重定向到目标域的根目录
我们在 htdocs 中的 .htaccess 文件目前看起来像这样...
# BEGIN WordPress
<IfModule mod_rewrite.c>
AllowOverride All
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
提前感谢您提供的任何帮助或见解。 史蒂夫 H-B
【问题讨论】:
标签: wordpress .htaccess multisite