使用参数将子域重定向到另一个域
Redirect sub domain to another domain with parameters
我需要重定向子域 (http://xxxxx.greetandcare.me/?mode=yyyyy) to another domain (https://anotherdomain.com/__/verify?mode=yyyyy)
- 我尝试添加 NS、TXT、CNAME 和 A 记录来实现此目的,但我无法应用这些设置,因为这些引发了错误。
如果输入URL时在网络浏览器中重定向,如果有解决方案就好了。
您无法单独使用 DNS 来完成此操作。您需要有一个 Web 服务器(例如 Apache、nginx)在您的第一个域中响应 HTTP 请求,该域可以将请求转发到您的第二个域。
如果您使用的是 AWS,Amazon S3 可以通过其 webpage redirect functionality.
据我所知,您只能将域/子域重定向到另一个域。参数将作为重定向的一部分传递。
您使用的是 Apache 吗?然后你可以将它添加到你的 apache 的 .htaccess
RedirectMatch "^/?mode=yyyyy/?$" "https://anotherdomain.com/__/verify?mode=yyyyy"
将域添加到 Cloudflare 以管理 DNS 并创建页面规则来实现需求。
如果网站是 https://example.com/* then the page rule redirects it to https://othersite.com/$1
这里$1是*
的内容
我需要重定向子域 (http://xxxxx.greetandcare.me/?mode=yyyyy) to another domain (https://anotherdomain.com/__/verify?mode=yyyyy)
- 我尝试添加 NS、TXT、CNAME 和 A 记录来实现此目的,但我无法应用这些设置,因为这些引发了错误。
如果输入URL时在网络浏览器中重定向,如果有解决方案就好了。
您无法单独使用 DNS 来完成此操作。您需要有一个 Web 服务器(例如 Apache、nginx)在您的第一个域中响应 HTTP 请求,该域可以将请求转发到您的第二个域。
如果您使用的是 AWS,Amazon S3 可以通过其 webpage redirect functionality.
据我所知,您只能将域/子域重定向到另一个域。参数将作为重定向的一部分传递。
您使用的是 Apache 吗?然后你可以将它添加到你的 apache 的 .htaccess
RedirectMatch "^/?mode=yyyyy/?$" "https://anotherdomain.com/__/verify?mode=yyyyy"
将域添加到 Cloudflare 以管理 DNS 并创建页面规则来实现需求。
如果网站是 https://example.com/* then the page rule redirects it to https://othersite.com/$1
这里$1是*
的内容