ASP重定向不起作用

时间:2014-05-06 07:37:48

标签: asp.net vb.net redirect

我是asp.net的新手。有什么明显的原因导致这种情况无效吗?

<%

If Request.Url.ToString.ToLower.IndexOf("http://www.secondarydomain.com") > -1 Then
    Server.Transfer("secure/login.aspx")
Else
    Response.Redirect("index.php")

End If

%>

我需要的是重定向到&#34; secure / login.aspx&#34;当用户访问www.secondarydomain.com并在用户访问www.primarydomain.com时将其重定向到index.php

目前,www.secondarydomain.com工作正常,但www.primarydomain.com说&#34;页面没有正确重定向&#34;

Global.asax的内容

<%@ Application Codebehind="Global.asax.vb" Inherits="CompanyLogin.Global" %>

Chrome提供的错误:

The webpage at http://primarydomain.com/index.php has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

Error code: ERR_TOO_MANY_REDIRECTS

此外,我不确定这是否会导致问题,但index.php文件用于WordPress安装,这里是WordPress .htaccess文件的内容:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

尝试访问www.primarydomain.com时FireFox控制台的屏幕截图:

redirect_console

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

应该是http://www.website.com而不是website.com。