• Home
  • Technology
    • Ebullientech
    • Entrepreneurship
    • Video Technology
    • Cloud Computing
    • Business Analysis
  • Thoughts
    • Food
    • General
    • Stories
    • Places
    • Workplace
    • Social Issues
    • Reviews
  • Quotes
  • Ebullientech News and Events
  • About

Kamalika's Notebook

thinking nothing...............!!

You are here: Home / Kamalika / Technology / Apache / HTTP Status Codes

HTTP Status Codes

April 19, 2015 By Kamalika 4 Comments

What is Http?

As per Wikipedia definition… “The Hypertext Transfer Protocol (HTTP) is an application protocol for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web. Hypertext is structured text that uses logical links (hyperlinks) between nodes containing text.”

Whenever a request is made to a server for any page (webpage) of any website an HTTP status code is the response to the request. A request is made when a search engine crawler (like Googlebot) crawls the page or a user tried to open the page in a web browser.

This status code provides the information about status of the request. Some of the common status codes are:

  • 200 – The server successfully processed the request. Generally, this means that the server provided the requested page
  • 301 – The page is permanently moved
  • 404 – The requested page doesn’t exist
  • 500 – Internal server error

HTTP Status codes are always three-digit numbers. The first digit of status code begins with one of five numbers, 1 through 5. From the 100s through the 500s, status codes are divided into following categories:

  • 100s – Informational: Request has been received and the process is continuing
  • 200s – Success: Request was received and processed successfully
  • 300s – Redirection: Request has been received, but needs to perform an additional step to complete the request
  • 400s – Client Error: Request was made by the client, but the page is not valid
  • 500s – Server Error: Valid request was made by the client, but the server failed to complete the request

Below I have shared a few learning resources on HTTP Status Codes:

  • Wikipedia: http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
  • IETF: http://www.ietf.org/assignments/http-status-codes/http-status-codes.xml
  • W3C: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
  • REST API: http://www.restapitutorial.com/httpstatuscodes.html

HTTP Status Code and PHP

PHP has a function http_response_code which gets or sets the HTTP Response / Status Code.

If you pass no parameters then http_response_code will get the current status code. If you pass a parameter it will set the response code.

[php]

<?php

http_response_code(404);

echo http_response_code();

?>

[/php]

The above code will first set the http status code to 404 and then print the current status code, i.e., 404.

Please note that this http_response_code was introduced in PHP 5.4.

Filed Under: Apache, HTTP, Technology Tagged With: Cloud Architect Mumbai India, http, http status codes, Tech Consultant Mumbai India

« Install the PHP DOM Extension on CentOS
How To Get Posts Category In WordPress »

Comments

  1. Joydip Roy Chowdhury says

    April 21, 2015 at 6:19 pm

    Should expect more information.

    Reply
    • Kamalika says

      April 21, 2015 at 11:58 pm

      Please specify what exactly are you looking for because it is impossible to cover all kinds of status codes in a single article :)

      Reply
  2. Hex Alline says

    June 10, 2020 at 10:15 pm

    I’m new to this IT world & it’s very use-full information for me.
    Thank you @kamalika.

    Reply
  3. Maleate Zed says

    June 10, 2020 at 11:04 pm

    It’s very use-full information for about Status code.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Connect with Facebook

Let’s connect…

  • Facebook
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube

Hello There…

I'm Kamalika, a techpreneur & startup mentor, blogger, hobbyist photographer, Netflix & Kindle indulgent, food connoisseur, Starbucks aficionado and former Disney employee ...next

Looking for something?

Tags

All in One SEO Pack AWS Banaras Blogger Blogging Blogs Creating Backup Schedule in RHEL 5 Dasaswamedh Ghat Ebullientech Ebullientech Interactive LLP Facebook Facebook Developers GeoTech GeoTech Informatics HipHop for PHP iPhone iPhone Apps Kamalika Guha Roy Kashi Ganga LAMP MindTwister MySQL Nabaneeta Guha Roy Online Marketing PayPal PayPal's suspension of Indian bank transactions Pentago PHP PHP & MySQL Saraswati Puja Search Engine Optimization SEO The Ganges TypePad UCO HUT UTV Indiagames Varanasi Web 2.0 Web 2.0 Design Web Design Web Marketing Website Design WordPress WordPress.COM WordPress.ORG

Timeline

  • 2020 (7)
  • 2019 (4)
  • 2018 (1)
  • 2015 (6)
  • 2014 (13)
  • 2013 (9)
  • 2010 (7)
  • 2009 (2)

Topics

Copyright © 2021 · Kamalika Guha Roy, Powered by Ebullientech Interactive LLP