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.

shuttle to Midway Beardstown .. Lockport Chicago limo O’Hare
In The News:

The FBI has issued a warning that scammers are impersonating doctors, police and banks using spoofed numbers as "smishing" texts surge nationwide.
Communities with unreliable internet service stand to gain after Amazon's Project Kuiper launched its first full batch of satellites into orbit April 28.
Tech expert Kurt “CyberGuy" Knutsson says unsubscribing from spam might actually backfire. Learn when to avoid it and stop junk effectively.
Tech expert Kurt “CyberGuy" Knutsson talks about how the first nonstop beating heart transplant, called zero ischemic time, at Taiwan hospital changes surgery.
Kurt “CyberGuy" Knutsson: FBI warns of "time-traveling" hackers.
Kurt “CyberGuy" Knutsson talks about a soft, vine-like robot called SPROUT that aids safe survivor rescues in collapsed buildings.
Health insurance giant Blue Shield of California confirmed it had been sharing private health data of 4.7 million users with Google for three years without even realizing it.
Delta and JetZero’s blended wing body aircraft marks a meaningful step toward a cleaner, quieter and more efficient future for air travel.
Recent reports show many common passwords can be cracked in literally seconds. Kurt the CyberGuy explains how to strengthen your passwords.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Iron, a robot that stands 5 feet, 8 inches tall and weighs 154 pounds, combines advanced artificial intelligence with human-like movement and exceptional vision.
Hertz, the rental car giant, recently confirmed that customer information was exposed through a cyberattack on one of its software vendors.
There are a number of features with AirPods you may or may not know about to take your listening experience to the next level. Kurt the CyberGuy explains.
These 35 Chrome extensions have privacy and security concerns. Tech expert Kurt “CyberGuy" Knutsson says to delete them now.
Tech expert Kurt “CyberGuy" Knutsson says 329,000 mph fusion rocket promises to be fast, disruptive and enable deep-space missions.
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 expert Kurt “CyberGuy" Knutsson says a new autonomous AI is a game changer that also raises privacy risks. Is your data safe?
Tech expert Kurt “CyberGuy" Knutsson says robots and drones are revolutionizing fruit farming with faster picking and smarter handling.
Landmark Admin revises May 2024 cyberattack scope to show twice as many people were affected. Kurt “CyberGuy" Knutsson gives tips to help stay safe from an insurance data breach.
Tech expert Kurt “CyberGuy" Knutsson talks about how Yamaha’s hydrogen outboard motor could revolutionize boating with zero emissions.
Tech expert Kurt “CyberGuy" Knutsson reveals how to memorialize or remove a deceased loved one’s Facebook account and protect their digital legacy from misuse or scams.
Tech expert Kurt “CyberGuy" Knutsson says an Apple Watch saved psychiatrist Amanda Faulkner by detecting deadly leukemia early.
Scammers and fraudsters are increasingly targeting the most vulnerable, especially nursing homes and the personal data of their residents. Kurt the CyberGuy has safety tips.
Infected USB flash drives can spread malware among multiple organizations in ways that can easily bypass traditional security systems.
With a fully automated warehouse system and AI-powered robots, Ocado's Hive picks, packs and delivers grocery store orders in just a few minutes.

Planning A Usable Website: A Three-step Guide

A website is like an information flow, with you as... Read More

I Want To Be A Freelancer

So you have decided that you want to do freelance... Read More

Achieving Differentiation With Your Website

Internet Marketing is not a miracle marketing strategy ? competition... Read More

Website Sales: 10 Reasons Why People Dont Buy From You

You've put up a website to promote a product or... Read More

Website Success is Key

The popular search engine Google indexes over 8 billion websites.... Read More

Why a CSS Website Layout Will Make You Money

Although CSS layouts have been around for years, they haven't... Read More

Creating a Sticky Web Site

When used to describe a web site, the term "sticky"... Read More

Allocating Your Web Site?s Budget Properly

I had a client say something to me the other... Read More

Frequent Business Question: How Do You Start a Web Business?

Today it seems everyone is jumping on the entrepreneur bandwagon,... Read More

Top 7 Tips for Building an Antique Car Website

Like wine cars get more attractive to collectors as years... Read More

FREE Amber Alert Tickers for Your Website

Project Safekids provides webmasters a valuable tool which could save... Read More

The Secret Benefit Of Accessibility: Part 2 - A Higher Search Engine Ranking

An additional benefit of website accessibility is an improved performance... Read More

How To Evaluate Your Web Sites Performance

Setting up a website is the very first step of... Read More

Have You Got Your Ear To The Ground Or Your Head In The Sand?

What happened on your website yesterday? What about last week... Read More

How Disabled Users Access The Internet

In 1995 a new era of accessibility for disabled people... Read More

Three Things Every Website Should Do

When I started my company in 2002, I knew I... Read More

Does Your Business Really Need A Website?

Website, website, website, everyone says you need one. But do... Read More

How To Get Your Customers To Trust Your Website

Research reveals three important facts:1) The Internet is one of... Read More

The Secret Benefit Of Accessibility: Part 1 - Increased Usability

Web accessibility has so many benefits that I really do... Read More

10 Tips For A Successful Website

Have you ever thought the secret behind the success of... Read More

How to Increase Sales with Automation Improvements

How popular is online shopping? And is there room for... Read More

Building eCommerce Websites that Work - Part 2

Succeeding with an eCommerce website is a dream for many... Read More

Establishing Your Web Presence

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

How Worldly is Your World Wide Web?

The growth in Internet usage around the world is astounding... Read More

Build a Web Site that Works...Even for a Safari Hobby!

My life's greatest passion is a safari hobby. And what... Read More

Green Bay Hummer H2 SUV rentals ..