这个网页在asp.net中有一个重定向循环 [英] This webpage has a redirect loop in asp.net

查看:73
本文介绍了这个网页在asp.net中有一个重定向循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我已经购买了ssl证书以保护我的网页,因为您知道...

但是为了获得效果谷歌建议配置301重定向以重定向访问者和搜索引擎蜘蛛在保持搜索引擎排名的同时访问新页面。

现在我有一个主页,我将此代码放入其中:



< pre lang =xml> < script language = c# < span class =code-attribute> runat = server >

private void Page_Load(object sender,System.EventArgs e)
{
Response.Status =301永久移动;

Response.AddHeader(Location,https://www.gemeya.com);

}
< / script >



因为您知道继承母版页的每个页面也将继承此代码。

now我正在上传文件inlive(godaddy),然后在输入我的网址时,我得到一个错误说:

此网页有一个重定向循环
https://www.gemeya.com/上的网页导致了太多的重定向。清除此站点的cookie或允许第三方cookie可以解决问题。如果没有,它可能是服务器配置问题,而不是您的计算机的问题。





有人可以告诉我这个问题。



请有人告诉我是什么问题。

解决方案

请尝试使用代码



 <   script     language   =  c#    runat   =  server >  
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
Response.Status =301 Moved Permanently;
Response.AddHeader(Location,https://www.gemeya.com);
}
}
< / script >


Hi I have purchased a ssl certificate inorder to secure my webpages as you know...
But inorder to get the effect google suggest to configure a 301 redirect inorder to redirect visitors and search engine spiders to your new pages while maintaining your search engine ranking.
Now I have a masterpage and I am placing this code inside it:

<script language="c#" runat="server">

       private void Page_Load(object sender, System.EventArgs e)
       {
           Response.Status = "301 Moved Permanently";

           Response.AddHeader("Location", "https://www.gemeya.com");

       }
   </script>


as you know every page that inherit the masterpage will inherit this code also.
now I am uploading the file inlive(godaddy),then when typing my url now I got an error saying that:

This webpage has a redirect loop
The webpage at https://www.gemeya.com/ 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.



can someone tell me about this problem.

please can someone tell me what is the problem.

解决方案

Pls try with code

<script language="c#" runat="server">
   private void Page_Load(object sender, System.EventArgs e)
   {
        if (!IsPostBack)
        {
            Response.Status = "301 Moved Permanently";
            Response.AddHeader("Location", "https://www.gemeya.com");
        }
   }
</script>


这篇关于这个网页在asp.net中有一个重定向循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆