PHP Redirect

A PHP Redirect automatically transfers a web user from one URL to another. For example, typing foo.com in the browser automatically transfers the user to another URL bar.com.

The PHP Redirect command:

Replace [some-url] with the URL where you want the redirection to take place.

For example,

header("location: ./version2/index.html"); =>redirect to "index.html" page in subfolder called "version2"

header("location: http://www.yahoo.com"); =>redirect to a website called yahoo.com

If PHP is not available, it's also possible to use other redirects:

* HTTP Redirects

Replace [time] with seconds. This will pause the browser for the specified number of seconds. Replace [some-url] with the target URL you want to redirect.

For example,

The above HTTP based redirect needs to be in the region of the HTML code.

* JavaScript Redirects

setTimeout("location.href='[some-url]'", [time]);

Replace [time] with milliseconds. This will pause the browser for the specified number of seconds. Replace [some-url] with the target URL you want to redirect.

For example, setTimeout("location.href='http://www.yahoo.com'", 5000);

The above JavaScript based redirect can be either in the or region of the HTML code.

Usually a PHP redirect is much more reliable than other form of redirects like HTTP redirect or JavaScript based redirects. For example a JavaScript redirect may not work if a user's browser settings has JavaScript turned off.

The reason why PHP redirects will work no matter what settings users have on their browser is because PHP is server side script. It will not depend on browser settings that may affect JavaScript which is parsed on the client-side/user-side.

About the Author
Sanjib Ahmad, Freelance Writer and Product Consultant for http://www.marc8.com.

You are free to use this article in its entirety as long as you leave all links in place, do not modify the content, and include the resource box listed above.

In The News:

An artificial intelligence-powered home security system can fire paintballs and tear gas at trespassers. The camera identifies human faces and animals.
Technology expert Kim Komando gives her tips and tricks on enhancing your user experience a smartphone and other devices you use everyday.
A new camera called NUCA uses artificial intelligence to create deepfake photos of subjects by stripping away clothing in close to real time.
The Kimberley Kube trail-ready camper has a compact but spacious design and combines luxury, functionality and ruggedness for a weekend getaway.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Emails instructing you to reset your password for an account may be legitimate, or they may be scams. Kurt "CyberGuy" Knutsson explains.
Northrop Grumman's Manta Ray uncrewed underwater vehicle aims to revolutionize undersea missions — it glides through the ocean without human assistance.
Learn how to work Google's calendar application to streamline and organize your daily tasks from technology expert Kim Komando.
If you do not want Facebook to have automatic access to your private photos, follow our tips to protect yourself. Kurt “CyberGuy" Knutsson shows you how.
Kurt “CyberGuy" Knutsson goes into detail about Apple’s recent iOS update that allows iPhone users to instantly translate spoken language simply by using the Action Button.
Safeguarding your digital life with a reliable physical backup isn't just a precaution, it's a necessity. Kurt “CyberGuy" Knutsson provides the essential backup checklist.
Kurt “CyberGuy" Knutsson reveals how a Redditor exposed false recycling claims at their apartment, highlighting a report that only 21% of U.S. recyclables are processed.
Kurt "CyberGuy" Knutsson offers a travel toolkit featuring five technology tools to help you with booking flights and hotels for your summer vacation.
The bubble behind the clock on your iPhone can appear in different colors. Kurt "CyberGuy" Knutsson explains what each of those colors mean.
Scammers are using the power of artificial intelligence to mimic voices of people and are using the fake voices to commit crimes, like kidnappings.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Tech guru Kurt "CyberGuy" Knutsson explains the science behind the Invisibility Shield, a 6-foot shield that makes people become invisible.
The International Olympic Committee on Friday announced plans to use AI in various Olympic aspects, including athlete identification, training and judging.
Tech guru Kurt "CyberGuy" Knutsson explains an easy trick to avoid squinting while working or surfing the web by zooming in on your personal computer.
Streaming giant Roku has recently been targeted by a pair of cyberattacks, and the company confirmed over a half million Roku accounts were compromised.
The Land Aircraft Carrier combines an all-terrain, six-wheeled vehicle with a two-seat aircraft, which features electric vertical takeoff and landing.
The European Union has sent TikTok a "request for information" on the video sharing platform's newest app, TikTok Lite, under the Digital Services Act, with the aim to clean up social media.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
The FBI is warning the public about a recent phishing scam via text that claims its targets owe money in Pennsylvania for unpaid road toll charges.
Your Apple Music settings may be revealing to your contacts what you're listening to. Kurt "CyberGuy" Knutsson explains the process to change those settings.

Earning From Your Website

Before you start building your site, ask yourself "WHY?". Why... Read More

Streamline your Business Website with a Content Management System

I talk with so many people who have small businesses... Read More

Traffic for Webmasters

"If you build it, they will come"; is an age... Read More

Guide to Internet Business - Website Setup

After planning the design and content of your website, it's... Read More

Beyond Web Usability: Web Credibility

If you've been developing websites on Mars for the past... Read More

Establishing Your Web Presence

Part of the success of most home-based businesses is their... Read More

CPanel Fantastico - Features and Benefits

Fantastico is a 3rd-party cPanel add-on and can be purchased... Read More

Make Your Web Site User-Friendly!

Making a web site is easy. Making a good web... Read More

How Your Own Website Helps Your Small Business Grow

What do you mean, you don't have a website for... Read More

Improving Usability for Screen Reader Users

Simply ensuring your website is accessible to screen reader users... Read More

Top 10 Webmaster Challenges

Webmasters deal with a myriad of complex design challenges every... Read More

How to Get a Knock Out Website!

The first step in setting up an online business...Starting an... Read More

Successful Commercial Sites

Do you make your website just to entertain yourself or... Read More

35% Revenue Increase? from Your Website!

2 Golden Rules for an Engaging Website35% of visitors fail... Read More

Running An Effective Website

Running an effective website is a continuous process. I have... Read More

Product Promoting: Getting The Response

When you publish a content site there are times when... Read More

Is Your Web Site Talking to Your Customer?

A while ago one of my clients approached me and... Read More

Growing Your Meetings In CyberSpace

As increasing numbers of people search for information on the... Read More

Your Biggest Mistake When You Create a Website?

--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More

3 Reasons Why You Need URL Rewriting Module To Enchance Your Web

URL rewriting are major needs for your sites that produce... Read More

7 Tips to Make Your Order Page Work Harder

So your prospect, Mary, is sitting at the computer reading... Read More

Why You Need a Website

You hear a great deal about the Internet these days... Read More

Benefits Of An Accessible Website: Part 1 - Increase In Reach

The DDA (Disability Discrimination Act) states that service providers must... Read More

Web Success Secret - Keep Your Visitors Interested

Visitors to your site come looking for information or solutions... Read More

Find the Purpose of Your New / Proposed Website

Absolutely everything stems from the purpose of your website -... Read More