【发布时间】:2015-01-04 09:43:19
【问题描述】:
我正在学习转发 URL,但不确定我是否使用了正确的术语。这是我到目前为止所做的以及我正在努力完成的事情。我创建了一个网站“ABC.com”。我从 freenom.com 获得了一个名为“XYZ.cf”的免费域。 Freenom 让我将任何访问 XYZ.cf 的人“转发”到我的网站 ABC.com。
默认情况下,任何输入 XYZ.cf 的人都会被转发到我的 ABC.com 网站的 index.htm 文件。我希望能够给人们这个 URL:“XYZ.cf/special1.htm”,他们将能够访问我的 ABC.com 网站上的 special1.htm。它不仅仅是 special1.htm,任何看起来像“XYZ.cf/variable.htm”的文件都将被重定向到我的 ABC.com/variable.htm,其中变量将是任何文件名。
例如:
If I give people the url XYZ.cf/1.htm, they should end up at ABC.com/1.htm.
If I give people the url XYZ.cf/2.htm, they should end up at ABC.com/2.htm.
If I give people the url XYZ.cf/3.htm, they should end up at ABC.com/3.htm.
If I give people the url XYZ.cf/4.htm, they should end up at ABC.com/4.htm.
If I give people the url XYZ.cf/5.htm, they should end up at ABC.com/5.htm.
If I give people the url XYZ.cf/6.htm, they should end up at ABC.com/6.htm.
If I give people the url XYZ.cf/7.htm, they should end up at ABC.com/7.htm.
我只有 7 个这样的文件。而已。我需要做什么?
【问题讨论】:
-
如果您对多个 URL 执行此操作,您应该为此查看服务器端 URL 别名技术。随着网站的发展,在文件中执行此操作将需要大量工作。
-
我想我想为大约 7 个 URL 执行此操作。也就是说,XYZ.cf/1.htm 到 XYZ.cf/7.htm 应该转发/重定向到 ABC.com/1.htm 到 ABC.com/7.htm。最简单的实现方法是什么?