如何将域重定向到特定的“登陆页面"? [英] How do I redirect a domain to a specific "landing page"?

查看:52
本文介绍了如何将域重定向到特定的“登陆页面"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户有几个停放的域名.她希望这些域指向她主站点中的特定页面.例如:

My client has several parked domains. She wants those domains to point to specific pages in her main site. For example:

让我们假设她的主要网站上有一个关于卧室重新装修的页面.该页面位于 www.mainsite.com/bedrooms/

Let's pretend she has a page on her main site about bedroom redecorating. That page is located at www.mainsite.com/bedrooms/

假设她有一个名为 www.999bedrooms.com/的停放域名

And let's say she has a parked domain called www.999bedrooms.com/

她想将该域重定向到 www.mainsite.com/bedrooms/

She wants to redirect that domain to www.mainsite.com/bedrooms/

在不被搜索引擎惩罚的情况下,最好的方法是什么?

What's the best way to do this without being penalized by the search engines?

另外,请记住 www.mainsite.com/bedrooms 实际上是一个 WordPress 页面,因此它本身并不是服务器上的实际文件.

Also, keep in mind that www.mainsite.com/bedrooms is actually a WordPress page, so it's not an actual file on the server, per se.

谢谢!

推荐答案

(至少)有两种方法可以做到这一点.一种方式需要访问服务器上的某种配置,而另一种则不需要.我不知道您是否正在使用 Apache Web 服务器,但如果是,您可以将 mod_alias 添加到您的配置中并重新启动 Apache:

There are (at least) two ways to do this. One way requires access to some sort of configuration on the server, and the other doesn't. I don't know if you're using the Apache web server, but if you are, you would add mod_alias to your configuration and restart Apache:

a2enmod alias
apache2ctl graceful

然后将此添加到 999bedrooms.com 的 VirtualHost 部分:

Then add this to the VirtualHost section for 999bedrooms.com:

Redirect permanent / http://www.mainsite.com/bedrooms

那么你应该完成了.

另一种方式是在您放置在 http://999bedrooms.com/index.html,在 HEAD 部分放这样一行:

The other way is in an HTML file that you put at http://999bedrooms.com/index.html, put a line like this within the HEAD section:

<meta http-equiv="refresh" content="1; url=http://www.mainsite.com/bedrooms">

这是您有时会看到的请稍候,我们将您重定向到我们的主页"类型的重定向之一.不如基于服务器的好,但更容易做到.

This is one of those "Please wait while we redirect you to our main page" sorts of redirections that you see sometimes. Not as nice as the server-based ones, but easier to do.

希望这会有所帮助!

这篇关于如何将域重定向到特定的“登陆页面"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆