server side redirect is a method of URL redirection using an HTTP status code (eg, 301 Moved Permanently, 303 See Other and 307 Temporary Redirect) issued by a web server in response to a request for a particular URL. The result is to redirect user’s web browser to another web page with a different URL .

One method of implementing server-side redirects is the .htaccess file supported by Most Apache web servers. An example of the code used is as follows.

redirect 301 /index.html

Common uses of server-side redirects include:

  • redirecting people away from a discontinued server
  • load balancing
  • redirecting to error pages if discontinued URL is used
  • link use tracking, as done at the AltaVista search engine
  • spamdexing
  • ensuring old links bookmarks still work when a page is renamed
  • allowing users to use an abbreviated URL


PHP code for server-side redirect.

header ( "Location:" );

ASP.NET code for server-side redirect.

Response . AddHeader ( "Location:" );

Implementation in JavaServer Pages (JSP).

response . setHeader ( "Location" , "" );