.htaccess 将子域重定向到具有dns或htaccess的另一个域

.htaccess 将子域重定向到具有dns或htaccess的另一个域,.htaccess,dns,subdomain,plesk,.htaccess,Dns,Subdomain,Plesk,我想重定向子域.domain1.example到domain2.example,而不更改子域的URL 例如: subdomain.domain1.example=domain2.example subdomain.domain1.example/connexion=domain2.example/connexion 是否可以使用DNS或htaccess重定向(不是301或302) 这是一个有2个URL的网站。顺便说一下,我正在使用Plesk来处理我的服务器 我知道它在谷歌看来像是重复的内容,但我

我想重定向
子域.domain1.example
domain2.example
,而不更改子域的URL

例如:

subdomain.domain1.example
=
domain2.example

subdomain.domain1.example/connexion
=
domain2.example/connexion

是否可以使用DNS或
htaccess
重定向(不是301或302)

这是一个有2个URL的网站。顺便说一下,我正在使用Plesk来处理我的服务器

我知道它在谷歌看来像是重复的内容,但我不在乎

PS1:我可以使用rsync,但它不是很好的解决方案

PS2:我试过符号链接,但普莱斯克不喜欢

这是同一个网站,有两个URL。。。我想现在它看起来像是谷歌的重复内容”

因此,在这种情况下,它不是您想要的“重定向”,因为这会将主机名更改为
domain2.example

一种方法是:

  • 子域.domain1.example
    设置指向
    domain2.example的IP地址的DNS
    a
    记录
  • 域2.example的
    容器中,配置
    服务器别名
    ,以便服务器接受对
    子域.domain1.example的请求。例如:

    ServerAlias subdomain.domain1.example
    
  • 它是同一个网站,有两个URL……我想现在它对谷歌来说就像是重复的内容。”

    因此,在这种情况下,它不是您想要的“重定向”,因为这会将主机名更改为
    domain2.example

    一种方法是:

  • 子域.domain1.example
    设置指向
    domain2.example的IP地址的DNS
    a
    记录
  • domain2.example的
    容器中,配置
    ServerAlias
    ,以便服务器接受对
    子域.domain1.example的请求。例如:

    ServerAlias subdomain.domain1.example
    

  • subdomain.domain1.com
    当前如何配置?subdomain.domain1.com
    当前如何配置?是的,不是重定向,抱歉。谢谢你回复我,我会试试的!对于nginx,它是
    server\u name subdomain.domain1.example
    ?只是您在问题中讨论了
    .htaccess
    ,这是一个Apache配置文件。(?)我不是专家,我在plesk配置中有两个apache和nginx选项,所以我在配置字段中放置了ServerAlias和server_name。是的,不是重定向,对不起。谢谢你回复我,我会试试的!对于nginx,它是
    server\u name subdomain.domain1.example
    ?只是您在问题中讨论了
    .htaccess
    ,这是一个Apache配置文件。(?)我不是专家,我在plesk配置中有两个apache和nginx选项,所以我在配置字段中放置了ServerAlias和server_name。