Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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.
Posted 1-May-13 13:04pm
El Dev813
Edited 1-May-13 21:36pm
v2
Comments
Buzzby at 2-May-13 11:40am
   
Do you have to check if this is a postback?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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>
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,327
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,920


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 4 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100