Infinite 302 redirects on a site using Angular JS
-
I'm not quite sure what I'm seeing here. It's a site that uses Angular JS (version 1) and the crawl is showing infinite 302 redirects, but the redirects are all to the same URL?
Here's an example: https://www.razoo.com/us/story/Armco-Park-Foundation
Has anyone seen this before? What causes it and how do I counsel the client on how to fix it?
-
Indeed: thanks for the update. AngularJS is a great technique but relatively new and so much different from the techniques we've gotten used to working with in the past couple of years that this is an interesting case.
Good luck with the project and cool to see more people using AngularJS!
-
Thank you so much for following up, Katherine! We really appreciate it.
-
The pages are definitely 302 redirecting 10+ times - shown in both the Deepcrawl and Screaming Frog data, but not in the tools l like redirect checker. The redirects showed up in Screaming Frog and Deepcrawl.
I got my answer from Nicholas Chimonas who is on the Online Geniuses slack group and I've posted his response below.
-
Google Fetch & Render won't work as the site wasn't set up properly. And I got the data from Deepcrawl AND Screaming Frog, but that didn't help me with the why.
Nicolas Chimonas actually helped me figure it out and posted the answer on the Online Geniuses Slack group as well as the Tech SEO Google+ community, and here it is for all who are curious:
Nicholas ChimonasJun 7, 2016<a data-content="Figured%20I'd%20post%20my%20thoughts%20for%20the%20community%20here%20that%20I%20brought%20up%20in%20the%20Online%20Geniuses%20slack.%3Cbr%3E%3Cbr%3EAngular%20is%20throwing%20a%20wrench%20in%20the%20works%2C%20I'm%20not%20sure%20cloaking%20is%20really%20the%20intent%20here%20%3Cspan%20class%3D%22proflinkWrapper%22%3E%3Cspan%20class%3D%22proflinkPrefix%22%3E%2B%3C%2Fspan%3E%3Ca%20class%3D%22proflink%20aaTEdf%22%20href%3D%22%2F117530250543183103093%22%20oid%3D%22117530250543183103093%22%3ERick%20Bucich%3C%2Fa%3E%3C%2Fspan%3E%26nbsp%3Byou'll%20notice%20the%20differences%20in%20code%20when%20you%20view-source%20versus%20inspect%20element%20with%20chrome%20dev%20tools.%3Cbr%3E%3Cbr%3EExcerpt%20taken%20from%20%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22http%3A%2F%2Fipullrank.com%2F6-things-you-should-know-about-in-chrome-devtools%2F%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttp%3A%2F%2Fipullrank.com%2F6-things-you-should-know-about-in-chrome-devtools%2F%3C%2Fa%3E%20%3A%3Cbr%3E%22First%20things%20first%2C%20View%20Source%2C%20we%E2%80%99ve%20had%20great%20times%20together%2C%20but%20it%E2%80%99s%20over.%20In%20the%20post-JavaScript%20age%2C%20there%20is%20little%20value%20in%20looking%20at%20the%20pure%20source%20code%20of%20a%20page%20before%20its%20JavaScript%20transformations.%20In%20fact%2C%20due%20to%20Google%E2%80%99s%20vast%20improvements%20in%20crawling%2C%20this%20is%20a%20fundamental%20flaw%20of%20all%20SEO%20crawling%20tools%20in%20that%20crawlers%20are%20not%20seeing%20the%20code%20as%20the%20user%20or%20Google%20sees%20it.%20Rather%2C%20SEO%20tools%20are%20seeing%20the%20code%20as%20it%E2%80%99s%20downloaded%20and%20not%20as%20it%E2%80%99s%20rendered.%20Granted%2C%20crawling%20with%20headless%20browsers%20is%20both%20slower%20and%20far%20more%20computationally%20expensive%2C%20but%20it%E2%80%99s%20also%20just%20a%20requirement%20at%20this%20point%20given%20the%20adoption%20rate%20of%20JavaScript%20frameworks.%20If%20you%E2%80%99re%20not%20using%20Inspect%20Element%20to%20review%20code%2C%20you%20are%20likely%20missing%20a%20big%20part%20of%20the%20picture.%22%3Cbr%3E%3Cbr%3ESo..%20with%20that%20in%20mind%2C%20I%20also%20went%20the%20route%20of%20investigating%20the%20page%20with%20different%20user-agents.%20By%20the%20way%2C%20Katherine%20fetched%20the%20URL%20as%20Googlebot%20and%20was%20served%20a%20302%20redirect%20in%20WMT.%3Cbr%3E%3Cbr%3EThis%20is%20the%20URL%20as%20Googlebot%20sees%20it%2C%20as%20mentioned%20totally%20different%20outline%2C%20and%20text%2C%20and%20links%20on%20the%20page.%3Cbr%3E%3Cbr%3E%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22http%3A%2F%2Fi.imgur.com%2FqQ4kwm2.png%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttp%3A%2F%2Fi.imgur.com%2FqQ4kwm2.png%3C%2Fa%3E%3Cbr%3E%3Cbr%3EBoth%20of%20these%20red%20boxes%20in%20this%20image%20are%20links%20to%20%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22https%3A%2F%2Fwww.razoo.com%2Fstory%2FArmco-Park-Foundation%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttps%3A%2F%2Fwww.razoo.com%2Fstory%2FArmco-Park-Foundation%3C%2Fa%3E%3Cbr%3E%3Cbr%3EWhich%20resolves%20when%20browsing%20as%20Googlebot.%20Notice%20the%20lack%20of%20%2Fus%2F%20prior%20to%20%2Fstory%2F%2C%20navigate%20to%20the%20above%20URL%20and%20you'll%20be%20302%20redirected%20to%20the%20%2Fus%2F%20URL.%3Cbr%3E%3Cbr%3EVersus%20when%20I'm%20in%20chrome%2C%20%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22https%3A%2F%2Fwww.razoo.com%2Fstory%2FArmco-Park-Foundation%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttps%3A%2F%2Fwww.razoo.com%2Fstory%2FArmco-Park-Foundation%3C%2Fa%3E%20is%20a%20302%20redirect%20to%20%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22https%3A%2F%2Fwww.razoo.com%2Fus%2Fstory%2FArmco-Park-Foundation%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttps%3A%2F%2Fwww.razoo.com%2Fus%2Fstory%2FArmco-Park-Foundation%3C%2Fa%3E%3Cbr%3E%3Cbr%3E%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22http%3A%2F%2Fi.imgur.com%2Flw9ta0R.png%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttp%3A%2F%2Fi.imgur.com%2Flw9ta0R.png%3C%2Fa%3E%3Cbr%3E%3Cbr%3ESo%20that's%20where%20your%20redirect%20loop%20is%20coming%20from.%3Cbr%3E%3Cbr%3EThose%20links%20to%20%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22https%3A%2F%2Fwww.razoo.com%2Fstory%2FArmco-Park-Foundation%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttps%3A%2F%2Fwww.razoo.com%2Fstory%2FArmco-Park-Foundation%3C%2Fa%3E%20which%20are%20highlighted%20in%20red%20boxes%20only%20appear%20for%20Googlebot%2C%20they%20don't%20appear%20on%20the%20human%20browser%2C%20or%20the%20screaming%20frog%20without%20being%20headless%20and%20spoofed%20as%20Googlebot%3Cbr%3E%3Cbr%3ESo%20when%20Googlebot%20is%20served%20up%20a%20version%20of%20the%20page%20which%20302%20redirects%20them%20from%20%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22https%3A%2F%2Fwww.razoo.com%2Fstory%2FArmco-Park-Foundation%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttps%3A%2F%2Fwww.razoo.com%2Fstory%2FArmco-Park-Foundation%3C%2Fa%3E%20to%20%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22https%3A%2F%2Fwww.razoo.com%2Fus%2Fstory%2FArmco-Park-Foundation%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttps%3A%2F%2Fwww.razoo.com%2Fus%2Fstory%2FArmco-Park-Foundation%3C%2Fa%3E%20they%20instead%20are%20once%20again%20served%20%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22https%3A%2F%2Fwww.razoo.com%2Fstory%2FArmco-Park-Foundation%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttps%3A%2F%2Fwww.razoo.com%2Fstory%2FArmco-Park-Foundation%3C%2Fa%3E%20because%20the%20user-agent%20is%20Googlebot%2C%20which%20once%20again%20302%20redirects%20them%20to%20%3Ca%20rel%3D%22nofollow%22%20target%3D%22_blank%22%20href%3D%22https%3A%2F%2Fwww.razoo.com%2Fus%2Fstory%2FArmco-Park-Foundation%22%20class%3D%22ot-anchor%20aaTEdf%22%20jslog%3D%2210929%3B%20track%3Aclick%22%20dir%3D%22ltr%22%3Ehttps%3A%2F%2Fwww.razoo.com%2Fus%2Fstory%2FArmco-Park-Foundation%3C%2Fa%3E%20etc.%20ad%20infinitum%EF%BB%BF" data-profiledetails="%7B%22profileId%22%3A%22104133087852424173047%22%2C%22realName%22%3A%22Nicholas%20Chimonas%22%7D">Share</a>Figured I'd post my thoughts for the community here that I brought up in the Online Geniuses slack.
Angular is throwing a wrench in the works, I'm not sure cloaking is really the intent here +Rick Bucich you'll notice the differences in code when you view-source versus inspect element with chrome dev tools.
Excerpt taken from http://ipullrank.com/6-things-you-should-know-about-in-chrome-devtools/ :
"First things first, View Source, we’ve had great times together, but it’s over. In the post-JavaScript age, there is little value in looking at the pure source code of a page before its JavaScript transformations. In fact, due to Google’s vast improvements in crawling, this is a fundamental flaw of all SEO crawling tools in that crawlers are not seeing the code as the user or Google sees it. Rather, SEO tools are seeing the code as it’s downloaded and not as it’s rendered. Granted, crawling with headless browsers is both slower and far more computationally expensive, but it’s also just a requirement at this point given the adoption rate of JavaScript frameworks. If you’re not using Inspect Element to review code, you are likely missing a big part of the picture."So.. with that in mind, I also went the route of investigating the page with different user-agents. By the way, Katherine fetched the URL as Googlebot and was served a 302 redirect in WMT.
This is the URL as Googlebot sees it, as mentioned totally different outline, and text, and links on the page.
http://i.imgur.com/qQ4kwm2.png
Both of these red boxes in this image are links to https://www.razoo.com/story/Armco-Park-Foundation
Which resolves when browsing as Googlebot. Notice the lack of /us/ prior to /story/, navigate to the above URL and you'll be 302 redirected to the /us/ URL.
Versus when I'm in chrome, https://www.razoo.com/story/Armco-Park-Foundation is a 302 redirect tohttps://www.razoo.com/us/story/Armco-Park-Foundation
http://i.imgur.com/lw9ta0R.png
So that's where your redirect loop is coming from.
Those links to https://www.razoo.com/story/Armco-Park-Foundation which are highlighted in red boxes only appear for Googlebot, they don't appear on the human browser, or the screaming frog without being headless and spoofed as Googlebot
So when Googlebot is served up a version of the page which 302 redirects them fromhttps://www.razoo.com/story/Armco-Park-Foundation to https://www.razoo.com/us/story/Armco-Park-Foundation they instead are once again served https://www.razoo.com/story/Armco-Park-Foundation because the user-agent is Googlebot, which once again 302 redirects them to https://www.razoo.com/us/story/Armco-Park-Foundation etc. ad infinitum
-
Sounds like Deepcrawl, Screaming Frog, and Google Fetch & Render.
-
Hi Katherine,
Hmm difficult to answer that question since we don't know the techniques you are using on this site. Apart from AngularJS.
This site show me a 200-header code. Which is an indication that everything is OK.
http://www.webconfs.com/http-header-check.php
What site gave you the 302-header code? One of MOZ's tools?
Bas
-
I should clarify that I'm seeing the redirect chain in Deepcrawl and Screaming Frog, and via Google's fetch and render tool inside Google Search Console.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
301 Redirects... Redirect all content at once or in increments?
Hello, I have been reading a lot about site migration and 301s and sometimes get confused with conflicting suggestions from different sources... So, in a site migration. Should I 301 redirect all old URLs to the news at once or little by little? I've see this Google handout that suggests doing it all at once (minute 13)
Intermediate & Advanced SEO | | Koki.Mourao
https://plus.google.com/u/0/events/cfco632lor7bl55j3tg1g8332l0 But also have read the opposite in other forums...0 -
Is there an advantage to using rel=canonical rather than noindex on pages on my mobile site (m.company.com)?
Is there an advantage to using link rel=alternate (as recommended by Google) rather than noindex on pages on my mobile site (m.company.com)? The content on the mobile pages is very similar to the content on the desktop site. I see Google recommends canonical and alternate tags, but what are the benefits of using those rather than noindex?
Intermediate & Advanced SEO | | jennifer.new0 -
Can I undo 301 redirects to purchase site
A website I am thinking of buying has 301 redirected all pages on his site to one page that explains the site is closing down. If I tell him to change the 301 to 302s will I be able to recover the old pages on the site and keep the authority, rankings and link power of the old pages and not the "Closing page"? Is all i have to do is undo the 301 redirects and everything will go back to how the site was before the 301s were in place? Or will I lose all the link power on individual pages because they already transferred to the "Closing page"? Thanks!
Intermediate & Advanced SEO | | atomiconline0 -
Why is this url redirecting to our site?
I was doing an audit on our site and searching for duplicate content using some different terms from each of our pages. I came across the following result: www.sswug.org/url/32639 redirects to our website. Is that normal? There are hundreds of these url's in google all with the exact same description. I thought it was odd. Any ideas and what is the consequence of this?
Intermediate & Advanced SEO | | Sika220 -
Server responds with 302 but the pages doesn't appear to redirect?
I'm working on a site and am running some basic audits, including a campaign within Moz. When I put the domain into any of these tools, including response header checkers, the response is a 302 that says there is a redirect to an Error Page. However, the page itself doesn't redirect, and resolves fine in the browser. But all of the audit tools cant seem to get any information from any of the pages. What is the best way to troubleshoot what is going on here? Thanks.
Intermediate & Advanced SEO | | jim_shook0 -
.htaccess 301 Redirect Help! Specific Redirects and Blanket Rule
Hi there, I have the following domains: OLD DOMAIN: domain1.co.uk NEW DOMAIN: domain2.co.uk I need to create a .htaccess file that 301 redirects specific, individual pages on domain1.co.uk to domain2.co.uk I've searched for hours to try and find a solution, but I can't find anything that will do what I need. The pages on domain1.co.uk are all kinds of filenames and extensions, but they will be redirected to a Wordpress website that has a clean folder structure. Some example URL's to be redirected from the old website: http://www.domain1.co.uk/charitypage.php?charity=357 http://www.domain1.co.uk/adopt.php http://www.domain1.co.uk/register/?type=2 These will need to be redirected to the following URL types on the new domain: http://www.domain2.co.uk/charities/ http://www.domain2.co.uk/adopt/ http://www.domain2.co.uk/register/ I would also like a blanket/catch-all redirect from anything else on www.domain1.co.uk to the homepage of www.domain2.co.uk if there isn't a specific individual redirect in place. I'm literally tearing my hair out with this, so any help would be greatly appreciated! Thanks
Intermediate & Advanced SEO | | Townpages0 -
Redirecting one site to another for link juice
I have two sites with same theme - buying cars. I am going remove one of the sites from being crawled permenantly (ie junkthecars.com) and point domian via 301, to another similar theme site (sellthecars.com). The purpose is to simply pass the SEO link juice from one site to the other as we retire junkthecars.com.... Is a forwarding of the domain OK and the best way for the search engines to increase the rank of sellthecars.com (we hate to wast the link work done on Junkthecars.com)? What dangers should I look for that could hurt sellthecars.com if we do the redirect at a simple TLD?
Intermediate & Advanced SEO | | bestone0 -
Should you cache redirects?
I would like to know what fellow SEO people think, should you cache a redirect? Problems I see with caching redirects are meta refreshes and there might be a slow down in page load, but is it a big issue? Should we cache redirects? Do pages get indexed more if you cache redirects? Our ecommerce product pages are all dynamic, and currently we cache redirects but i'm seeing a lot of meta refresh issues. Another area that cropped up is that, the redirect doesn't pass on query parameters. Our system dumps URLs and they are redirected to SEO ones, but the redirect doesn't pass on parameters like Google Analytic tracking tags. What are your thoughts? Thanks
Intermediate & Advanced SEO | | Bio-RadAbs0