我是新來的asp.net。有沒有明顯的原因,爲什麼這不工作?ASP重定向不工作
<%
If Request.Url.ToString.ToLower.IndexOf("http://www.secondarydomain.com") > -1 Then
Server.Transfer("secure/login.aspx")
Else
Response.Redirect("index.php")
End If
%>
我需要的是爲它重定向到「安全/ login.aspx的」當用戶訪問www.secondarydomain.com和它重定向到index.php當用戶vists www.primarydomain.com
目前,www.secondarydomain.com工作正常,但www.primarydomain.com說 「的頁面沒有正確重定向」 的Global.asax
<%@ Application Codebehind="Global.asax.vb" Inherits="CompanyLogin.Global" %>
爾
內容ROR是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文件的內容:
試圖訪問www.primarydomain.com當Firefox控制檯的# 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
截圖:
任何幫助深表感謝。
你得到的實際錯誤是什麼?說實話*「頁面沒有正確重定向」*就像它們來的一樣通用。 – Lankymart
就是你所有的全局文件。應用程序啓動或會話啓動時沒有重定向?如果不是這種情況,請嘗試重置Cookies並檢查。 –
@Lankymart我會得到實際的錯誤。 – RipzCurlz