Use telnet to check the header status code returned by the web site

Source: Internet
Author: User

Here is just a description of how telnet (similar tools such as NC) can be detected.


Start -- run -- cmd

(The preceding steps can be omitted in Linux)

Telnet in the command line, and then

...> Telnet 80

Open TCP connection port 80 (default HTTP server port) at, and the subsequent content will be sent to port 80 of

Enter an HTTP request message (case sensitive ):

Getindex. php HTTP/1.1


After you type this command (you did not see anything because the ECHO is not enabled for your Telnet, press the Enter key twice), you can minimize this (but complete) the GET request is sent to the HTTP server. Note that the information sent from the server is the information you want. For example, I want to see if is correct. 301 redirect to The information I get is as follows:

HTTP/1.0 301 moved permanently
Date: Mon, 18 Feb 2008 07:53:13 GMT
Server: Apache
X-powered-by: PHP/4.4.7
Set-COOKIE: PHPSESSID = aa8d8b1c23e1d783d485c72161dd559e; Path =/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-control: No-store, no-cache, must-revalidate, post-check = 0, pre-check = 0
Pragma: No-Cache
Content-Type: text/html; charset = UTF-8
X-Cache: Miss from
Via: 1.0 80 (SQUID)
Connection: Close

This is OK. We can see that 1.0 after HTTP/301 indicates that 301 redirection is correct. Then we can check the location at the end. Now we are sure that 301 has been correctly redirected to

The above is only a telnet test HTTP server.

The following two websites can directly enter the website address to help you detect the header information status code returned by the website



In the URL input dialog box, after the URL is submitted (sumbit), the header information status code returned by the URL you entered is displayed.

If your website (your same site) has multiple 200 OK codes on it, you should use 301 to permanently redirect unnecessary URLs to the primary URL (what you want). One redirection is 302, which indicates temporary redirection.

For how gogole and Baidu treat 301 redirection, refer to what I just recorded:/search-engine/google-and-baidu-301-redirects-index-recorded-observation-443.shtml

From: use Telnet to check the header information status code returned by the web site


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.