2

请建议使用 .htaccess 以外的其他方法。

4

4 回答 4

7

今天真的是作业到期日。

有 httpd.conf (apache) http://httpd.apache.org/docs/1.3/configuring.html

或者,强制执行“错误 301 - 重定向”。

或者,您可以在重定向到新网页的网页中放置元刷新。例如
<meta http-equiv="REFRESH" content="0;url= http://www.the-domain-you-want-to-redirect-to.com ">

或者您可以使用 javascript 强制重定向。

<script type="text/javascript">
window.location = "http://www.google.com/"
</script>

然后有诸如反向代理之类的东西可以做你想做的事。

于 2009-02-16T12:16:14.827 回答
2

根据技术和/或您对 Web 服务器的访问,有多种选择。除了上述之外,您还可以使用服务器端代码重定向,例如在 ASP.Net 中

Response.Redirect("http://www.google.co.uk")

我确信有 PHP 和其他各种代码替代方案可以执行相同的操作。

于 2009-02-16T12:24:22.890 回答
1

您可以使用 index.html 和 META Refresh 标签进行客户端重定向。

    <html>
        <head>
            <meta http-equiv="refresh" content="0;url=http://www.mysite.com/MyDir/MyPage.html" />
        </head>
    </html>

http://en.wikipedia.org/wiki/Meta_refresh

于 2009-02-16T12:14:59.683 回答
0

实现无关:

以下状态代码可用于 Web 服务器响应:

如果您无法访问像样的 Web 服务器,请尝试上面的 Javascript 或 Meta-Tag 方法。

奖励:另一个特定于实现的建议,使用Hunchentoot

(redirect "http://otherhost/otherpath")
于 2009-02-16T16:31:58.957 回答