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
-
Updating 2013 Site Built with Custom Theme, Modify Existing Theme, Create New Custom Theme, Or Use Child Theme?
Our website was designed in 2013 using a custom theme. Some of the plugins are built from scratch. Ranking in our industry is hyper competitive. We are seeking a better interface and also to improve ranking. I have read that custom themes use lighter code and can rank better. Does this apply to a custom theme from 2013? Will we have an SEO advantage using a custom theme? If so, will that advantage be significant? We are using a discontinued plugin called "Firestorm" to display real estate listings. That plugin has been customized. Can we use that plugin on a new "custom" theme? How about on a "child" theme? In terms of the cost of future maintenance, will a "custom" theme require much more intervention (manual installation of updates) moving forward? Which of the following options is best: 1. Adapt our existing custom theme
Intermediate & Advanced SEO | | Kingalan1
2. Create a new custom theme
3. Create a child theme Thanks,
Alan0 -
How to handle potentially thousands (50k+) of 301 redirects following a major site replacement
We are looking for the very best way of handling potentially thousands (50k+) of 301 redirects following
Intermediate & Advanced SEO | | GeezerG
a major site replacement and I mean total replacement. Things you should know
Existing domain has 17 years history with Google but rankings have suffered over the past year and yes we know why. (and the bitch is we paid a good sized SEO company for that ineffective and destructive work)
The URL structure of the new site is completely different and SEO friendly URL's rule. This means that there will be many thousands of historical URL's (mainly dynamic ones) that will attract 404 errors as they will not exist anymore. Most are product profile pages and the God Google has indexed them all. There are also many links to them out there.
The new site is fully SEO optimised and is passing all tests so far - however there is a way to go yet. So here are my thoughts on the possible ways of meeting our need,
1: Create 301 redirects for each an every page in the .htaccess file that would be one huge .htaccess file 50,000 lines plus - I am worried about effect on site speed.
2: Create 301 redirects for each and every unused folder, and wildcard the file names, this would be a single redirect for each file in each folder to a single redirect page
so the 404 issue is overcome but the user doesn't open the precise page they are after.
3: Write some code to create a hard copy 301 index.php file for each and every folder that is to be replaced.
4: Write code to create a hard copy 301 .php file for each and every page that is to be replaced.
5: We could just let the pages all die and list them with Google to advise of their death.
6: We could have the redirect managed by a database rather than .htaccess or single redirect files. Probably the most challenging thing will be to load the data in the first place, but I assume this could be done programatically - especially if the new URL can be inferred from the old. Many be I am missing another, simpler approach - please discuss0 -
Does Google Index URLs that are always 302 redirected
Hello community Due to the architecture of our site, we have a bunch of URLs that are 302 redirected to the same URL plus a query string appended to it. For example: www.example.com/hello.html is 302 redirected to www.example.com/hello.html?___store=abc The www.example.com/hello.html?___store=abc page also has a link canonical tag to www.example.com/hello.html In the above example, can www.example.com/hello.html every be Indexed, by google as I assume the googlebot will always be redirected to www.example.com/hello.html?___store=abc and will never see www.example.com/hello.html ? Thanks in advance for the help!
Intermediate & Advanced SEO | | EcommRulz0 -
For URLs that require login, should our redirect be 301 or 302?
We have a login required section of our website that is being crawled and reporting as potential issues in Webmaster Tools. I'm not sure what the best solution to this is - is it to make URLs requiring a login noindex/nocrawl? Right now, we have them 302 redirecting to the login page, since it's a temporary redirect, it seems like it isn't the right solution. Is a 301 better?
Intermediate & Advanced SEO | | alecfwilson0 -
Backlinking 3 sites from same domain and backlinking main site too
Hello, we have 4 sites, in which 1 is a main site and rest 3 are niche sites All these 3 sites have dofollow links to main site from home page We got a high quality backlink - through which all 3 niche sites have got it from that domain Is it worth to add backlink from that domain to main site too, despite the fact the 3 sites already have recvd it and they all link to main site many thanks
Intermediate & Advanced SEO | | Modi0 -
Original Site content was used for submission to article directories
I had a communication problem with my writer and she used original unspun content and posted it to Unique Article Wizard. So all UAW does is take each paragraph and mix them up. So I searched a sentence on my site where the content came from and got back a bunch of returns for that sentence. My site wasn't the first result returned. I"m wondering how bad that is going to be for me. The links from UAW are going back to an anchor layer that then links back to this site. Can anyone tell me if I need to rewrite the content on the original site? That is the only way I can think to make that not an issue. Thanks
Intermediate & Advanced SEO | | mtking.us_gmail.com0 -
Login redirect 302
Ok - anyone knows what to do with the temporary redirect to the login page? In our e-commerce system we have a checkout page, which requires user to be logged in - if they are not, we redirect them to the login page using simple php header("Locaiton: url"). This however has been found as a Warning as it's a temporary redirect. I can't really put there permanent redirect for obvious reasons so if someone could give me some clue on this situation that would be much appreciated.
Intermediate & Advanced SEO | | coremediadesign0 -
On-Site Optimization Tips for Job site?
I am working on a job site that only ranks well for the homepage with very low ranking internal pages. My job pages do not rank what so ever and are database driven and often times turn to 404 pages after the job has been filled. The job pages have to no content either. Anybody have any technical on-site recommendations for a job site I am working on especially regarding my internal pages? (Cross Country Allied.com) Any help would be much appreciated.
Intermediate & Advanced SEO | | Melia0