Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > HELP my site gets a 302 temporary redirect

Reply
Thread Tools

HELP my site gets a 302 temporary redirect

 
 
Jeff
Guest
Posts: n/a
 
      01-07-2010
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?


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      01-08-2010
session uses a 302 o set the cookie

-- bruce (sqlwork.com)

Jeff wrote:
> 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?
>
>

 
Reply With Quote
 
 
 
 
Jeff
Guest
Posts: n/a
 
      01-08-2010
thank you

"bruce barker" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> session uses a 302 o set the cookie
>
> -- bruce (sqlwork.com)
>
> Jeff wrote:
>> 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?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Net::HTTP and handling 302 Redirect zeeboo Ruby 4 12-04-2010 07:56 AM
Net::HTTP::Put with 302 redirect? Chris McMahon Ruby 1 05-21-2007 09:35 PM
Want to call a custom handler that redirect and receive the http return code (302, 303 or 307) ThunderMusic ASP .Net 1 01-26-2007 04:30 PM
HTTP 302 (Response.Redirect) to mms:// URL gives error, to http:// is ok. David Morgan ASP General 1 02-24-2006 01:33 PM
Re: httpconnection class handle 302 redirect? Laszlo Zsolt Nagy Python 0 12-07-2004 05:36 PM



Advertisments