Subscribe: Comments on: Shit happens, your redirects hit the fan!
http://sebastians-pamphlets.com/how-to-avoid-troubles-caused-by-chained-redirects/feed/
Added By: Feedage Forager Feedage Grade A rated
Language: English
Tags:
anon coward  page  redirect  response write  server  session  sign server  sign  single sign  single  ticket  window location 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Comments on: Shit happens, your redirects hit the fan!

Comments on: Shit happens, your redirects hit the fan!



If you've read my articles somewhere on the Internet, expect something different here.



Published: Tue, 21 Nov 2017 21:33:28 +0000

 



By: Carter Cole

Fri, 06 Aug 2010 14:18:02 +0000

i built tool and API to enumerate redirect chains and show each status code along the way. Here is the redirect chain examiner along with the code to use API on your website



By: I Robot | Robots.txt Help | SebastianX of Sebastians Pamphlets | Hobo

Mon, 21 Jul 2008 09:35:22 +0000

[...] Shit happens, your redirects hit the fan! [...]



By: Anon Coward

Thu, 31 Jan 2008 07:03:30 +0000

ok looks like the blog engine is removing the link to the JS file. It is just a regular js link but with the src set to AmIAuthenticated.aspx on the authentication server



By: Anon Coward

Wed, 30 Jan 2008 14:32:14 +0000

Is what you output using Response.Write Missed out that bit on my original post... (after 'To do this output this to the bottom of your page using Response.Write or whatever:'



By: Anon Coward

Wed, 30 Jan 2008 14:27:59 +0000

Kristin - Here is (half) a .Net solution that I use (obviously very easy to write in php, ruby - anything). Do not automatically redirect anyone who hasn't already got a session on your Single Sign-On Server. But how do I do this you ask! Ok, here we go... In your content page if an authenticated session for the user does not exist then you need to check the Single Sign-on server to see if there is one there, right? To do this output this to the bottom of your page using Response.Write or whatever: "" As you can see this links into a code page on your Single Sign-on Server, not a javascript file (you could set up isapi filters or whatever to make the extension map to the .apsx handler also). What does AmIAuthenticated.aspx return? This: ---begin code If (Session("username") Is Nothing) Then returnScript = "" Else If (Request.UrlReferrer Is Nothing) Then returnScript = "window.location = '" ConfigurationSettings.AppSettings ("SessionServerUrl").ToString() "';" Else returnScript = "window.location = '" ConfigurationSettings.AppSettings("SessionServerUrl").ToString() "?redirectUrl=" Server.UrlEncode(Request.UrlReferrer.AbsoluteUri) "';" End If End If ---end code So if there was a session it takes the user (using JavaScript window.location) to the Single Sign-On server to pick up there ticket! So you only redirect people if js / cookies are working, and if they have already logged into you Single Sign-On Server, not search engine crawlers! Ok, I think that should get you started... P.s. If you can't get this going it is because of my bad explanation, the method works, I am using it...



By: Sebastian

Thu, 20 Dec 2007 20:56:15 +0000

Not sure why a ticket benefits a crawler, actually I guess that's worthless, so why not checking for legit search engine crawlers and delivering those the contents without any redirects?



By: kristin

Thu, 20 Dec 2007 20:31:00 +0000

Right now, I am redirecting 3 times for every page visit. 1. Redirect to the Single Sign-On server to get a ticket. 2. Redirect back to the page (service url) from the Single Sign-On server 3. Self-redirect without the ticket parameter This ofcourse is pissing off Google's web crawler. Any solution to avoid this?



By: The anatomy of a server sided redirect: 301, 302 and 307 illuminated SEO wise

Tue, 09 Oct 2007 14:58:32 +0000

[...] whatever) when it runs into a redirect condition. Some redirects are done by the server itself (see handling incomplete URIs), and there are several places where you can set (conditional) redirect directives: Apache’s [...]



By: Lorna

Sat, 06 Oct 2007 11:45:31 +0000

This is a great post for Googlebot dum-dums such as myself. I'm checking my server logs immediately.



By: Paul Pedersen

Thu, 27 Sep 2007 17:17:43 +0000

Great post. I've seen a great deal of this over the years.