将整个域重定向到特定页面而不更改浏览器中的 URL
Redirect entire domain to specific page without changing URL in browser
您好,有两个域在 Apache 下的 VirtualHost 中是别名。它目前正在托管一个简单的 WordPress。我想使用特定的 WordPress 页面作为第二个域的登录页面。
假设我有 domainmaster.com
和 domainlanding.com
,domainmaster.com
将加载 WordPress(从主页)。在后台访问 http://domainlanding.com, it will open http://domainmaster.com/wordpressroot/landingpage 时(在浏览器中看不到 URL 的变化)。
我已经能够使用 .htaccess
几乎可以工作的代码:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?domainlanding.com$
RewriteRule .* http://domainmaster.com/wordpressroot/landingpage [L]
唯一的问题是 URL 在浏览器中发生了变化。我在重写规则中没有 http://domainmaster.com
的情况下进行了测试,但它什么也没做。
注意:wordpressroot
目录在网站完成之前是临时目录。 WordPress 使用永久链接,因此他的目录下有一个 .htaccess
。
我终于想出了一个 WordPress 插件:Domain Mapping System 它运行良好!
您好,有两个域在 Apache 下的 VirtualHost 中是别名。它目前正在托管一个简单的 WordPress。我想使用特定的 WordPress 页面作为第二个域的登录页面。
假设我有 domainmaster.com
和 domainlanding.com
,domainmaster.com
将加载 WordPress(从主页)。在后台访问 http://domainlanding.com, it will open http://domainmaster.com/wordpressroot/landingpage 时(在浏览器中看不到 URL 的变化)。
我已经能够使用 .htaccess
几乎可以工作的代码:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?domainlanding.com$
RewriteRule .* http://domainmaster.com/wordpressroot/landingpage [L]
唯一的问题是 URL 在浏览器中发生了变化。我在重写规则中没有 http://domainmaster.com
的情况下进行了测试,但它什么也没做。
注意:wordpressroot
目录在网站完成之前是临时目录。 WordPress 使用永久链接,因此他的目录下有一个 .htaccess
。
我终于想出了一个 WordPress 插件:Domain Mapping System 它运行良好!