Click here to Skip to main content
15,921,577 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
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:

XML
<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
Updated 1-May-13 20:36pm
v2
Comments
Buzzby 2-May-13 11:40am    
Do you have to check if this is a postback?

1 solution

Pls try with code

XML
<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>
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900