HELP my site gets a 302 temporary redirect

J

Jeff

hey

asp.net 3.5

I've been testing my site against the free seo tool
http://www.instantposition.com/seotest.php and discovered that it gets a 302
temporary redirect. I've contacted the ISP and they say there is nothing
wrong with the server config or anything like that. He said it could be some
issues with my code or web.config.

But I don't know what that could be as I guess my code is pretty straight
forward. I don't do any redirect other than to avoid double posting forms

I used to have a canonical-url in the Defaut.aspx file, thought the problem
was caused by that one. Then I read that canonicalurl don't work so great on
IIS6 so I googled and came across an article which recommended this code
instead:
void Application_BeginRequest(object sender, EventArgs e)
{
string requestedDomain =
HttpContext.Current.Request.Url.ToString().ToLower();

if (requestedDomain.IndexOf("http.mysite.com") > 0 )
{
requestedDomain = requestedDomain.Replace("http://mysite.com",
"http://www.mysite.com");
Response.Clear();
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location", requestedDomain);
Response.End();
}
}

Don't think that code has anything to do with the problem, cause I haven't
seen any changes in the error after I removed the cannonicalurl and
implemented the code above. I guess it must be something else, but what I'm
not sure...

My site funnyquotesonline (dot) org which gets the 302 temporary redirect

any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top