如何将任何域名重定向到我们的网络应用程序

发布于 2024-09-25 14:23:03 字数 357 浏览 2 评论 0原文

我们有一个用 zend mvc (php) 编写的 saas Web 应用程序,用户可以在其设置页面中输入自己的域名。

当他们输入 www.customdomain.com 时,我们希望该域重定向到我们的 Web 应用程序,以便我们可以从我们的应用程序提供他们自己的页面。

我们已经通过在 DNS 配置中添加 *.ourapp.com 条目来对子域执行相同的操作。 这对于像 customdomain.ourapp.com 这样的子域非常有用。

这似乎不适用于 www.customdomain.com 等完整域名。

将任何域名地址链接到我们的应用程序的最简单方法是什么,这样我们就可以读出传入的域名并在我们的应用程序中采取相应的操作?

we have a saas web app, written in zend mvc (php) where users can enter their own domain name in their settings page.

When they enter e.g. www.customdomain.com we want this domain to redirect to our web application so we can serve up their own pages from our app.

We do the same already for subdomains by having a *.ourapp.com entry in our DNS configuration.
that works great for subdomains like customdomain.ourapp.com.

This doesn't seem to work for full domain names like www.customdomain.com.

What's the easiest way to have any domain address link to our application, so we can just read out the incoming domain name and act accordingly in our app?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽清梦 2024-10-02 14:23:03

要让 DNS 入口指向您的服务器:

  • 域已注册(并由客户拥有):让他将 CNAME 条目配置为您服务器的 IP。 (甚至谷歌也让最终用户手动完成此操作 - 因此自动化可能很难)

  • 域名是免费的:注册它,自己配置 CNAME(您拥有它)

如果您只想重定向,用户可以上传执行重定向的 html 文件或 .htaccess 文件。但这也必须由客户来完成。

For letting the DNS entry point at your servers:

  • Domain is already registered (and owned by the customer): Make him configure the CNAME entry to your server's IP. (Even google let this do the enduser by hand - so automating this might be hard)

  • Domain is free: Register it, configure the CNAME yourself (you own it)

If you only want a redirect, the user can upload a html file or .htaccess file, that performs the redirect. But this has to be done by the customer, too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文