I input the query java
into the search text box on https://www.google.com
. One result is https://en.wikipedia.org/wiki/Java_(programming_language)
. I get the following text by right clicking the link and selecting Copy Link Address
.
And I paste the above link to Chrome address bar. And I use Developer Tools
to monitor the HTTP network traffic.
The first HTTP request is for the original link. And its status code is 200. How does Chrome make the following request for https://en.wikipedia.org/wiki/Java_(programming_language)
?I know that a HTTP response with status code 302
can make brsowers following the link in Location
header. But how is the redirect done in this case with status code 200
?
The redirect is done because in the response of the first HTTP request (https://www.google.com/url?sa=t&rct=j...):
https://en.wikipedia.org/...
using script.<meta http-equiv="refresh">
is used to redirect to https://en.wikipedia.org/...
Here is the response body of the first HTTP request:
<script>window.googleJavaScriptRedirect=1</script>
<META name="referrer" content="origin">
<script>var n={navigateTo:function(b,a,d){if(b!=a&&b.google){if(b.google.r){b.google.r=0;b.location.href=d;a.location.replace("about:blank");}}else{a.location.replace(d);}}};n.navigateTo(window.parent,window,"https://en.wikipedia.org/wiki/Java_(programming_language)");
</script>
<noscript>
<META http-equiv="refresh" content="0;URL='https://en.wikipedia.org/wiki/Java_(programming_language)'">
</noscript>