Methods to redirect URLs (HTML, PHP and Javascript)

  • Spammers will be banned immediately without warning. Read our Signup Policies here.
  • 🎉 We've Hit 1 MILLION VIEWS in April 2025! 🚀

    We're proud to announce that blackhatforums.net has officially crossed 1,000,000 page views in a single month — April 2025! 🤯

    This milestone is a direct result of your hustle, strategies, and contributions. Whether you're dominating SEO, pushing traffic, or just absorbing knowledge — this is your win. 💪

    👉 Read the Celebration Thread Here

    — The blackhatforums.net Team

romeo

Newbie
Messages
28
Likes
1
Points
3
In this tip , I show you several methods to redirect URLs. That is, that when you enter a web page automatically sent to another.

Method 1. HTML

The first method is to use the element GOAL . Let syntax use for our purpose:
Code:
<Meta  http-equiv = "action"  content = "seconds" ; url = "url destination"  />

Suppose you changed your server or you have moved a page to another directory. Show a message about it and are forwarding our user to the new page location. In this example, the action will "refresh" the time it takes to refresh the page shall be five (5) seconds:
Code:
<Html> 
<head> 
<meta  http-equiv ="Refresh"  content ="5; url=http://www.blackhatboard.com" > 
</ head>

<Body> 
<p> We have moved! You will be automatically redirected in five seconds. Otherwise, you can access by clicking <a  href = "http://www.blackhatboard.com"> here </a> </ p> 
</ body> 
</ html>

Method 2. PHP

The following example will redirect the user without notice:
Code:
<? php
header ( "Location: http://www.blackhatboard.com" ); 
>?

3. Method JavaScript

We can do with JavaScript , the methods previously seen. In the case of a redirect on hold, we must use a "timer". Here's an example:
Code:
<html> 
<head> 
<script  type = "text/javascript" > 
function redireccionar (){ 
  window . locationf = "http://www.blackhatboard.com" ; 
}  
setTimeout ( "redireccionar()" ,  5000 );  //tiempo in milliseconds 
</ script> 
</ head> 
<body> 
<p> Please wait will be redirected in five seconds. </ p> 
</ body> 
</ html>

Making directly, without waiting:
Code:
<Body> 
<script  type = "text / javascript" > 
window . location = "http://www.blackhatboard.com" ; 
</ script> 
</ body>

:)
 

Members online

No members online now.