Security, Tech & Programming
Redirect CheatSheet

Redirect CheatSheet

This page lists methods to redirect a webpage using various technologies.

How to redirect webpage using PHP

// make sure that there is no page output before this code

How to redirect webpage using JavaScript

// Simulate a mouse click:
window.location = "";
window.location.href = "";

// Simulate an HTTP redirect:
// (meddles with history & go back ability)

How to redirect using on webpage using html meta http-equiv

<!-- 30 is number of seconds to wait -->
<meta http-equiv="refresh" content="30, url=">

<!-- to simply refresh current page: -->
<meta http-equiv="refresh" content="30">

Leave a Reply

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

Hire Me!