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.

top rated cleaning service Lake Forest ..
In The News:

Android users can now manage apps across multiple devices more easily with Google Play Store's updated remote uninstall button in the latest update.
NASA's Perseverance rover discovers shiny metallic rock on Mars that could be a meteorite from an ancient asteroid, containing high levels of iron and nickel.
Holiday scams spike during Black Friday and Cyber Monday as criminals exploit your leaked personal data. Learn how to protect yourself from fake stores and phishing.
Commerce Department proposes TP-Link router ban over Chinese security risks. Learn how this potential prohibition could affect your home network and devices.
Hyundai AutoEver America suffered a data breach affecting 2,000 current and former employees, exposing names, Social Security numbers and driver's license information.
Washington court rules automated license plate reader images are public records, even when stored by vendors like Flock Safety, setting precedent for transparency.
Fake airline texts claiming flight cancellations are targeting travelers with convincing scams. Learn how cybercriminals steal personal data and credit card info.
Discover how iOS 26's new Adaptive Power feature automatically extends iPhone battery life by learning your usage patterns and adjusting performance intelligently.
New TikTok malware campaign tricks users into running PowerShell commands that download Aura Stealer, which steals credentials and authentication tokens.
Gaia Family offers fixed upfront pricing for IVF cycles with unlimited embryo transfers and financial protection, partnering with over 100 U.S. fertility clinics.
The Jetsons Act aims to position Pennsylvania as a leader in advanced air mobility by establishing regulations for hybrid ground-air vehicles.
Fake Geek Squad invoice emails are targeting users with convincing charges and urgent phone numbers to steal personal information and money.
Fox News Digital's artificial intelligence newsletter digs into a robot in Russia that faceplanted, George Clooney's alarm and OpenAI's rivalry with the New York Times.
Major data breach at Conduent exposes personal information of 10+ million people. Government contractor hit by cyberattack affecting Medicaid, child support systems.
Texas startup Janta Power raises $5.5M for innovative vertical solar towers that generate 50% more energy than traditional panels while using just one-third the land.
NASA's twin ESCAPADE spacecraft launched aboard Blue Origin's New Glenn rocket Thursday afternoon from Cape Canaveral, beginning their journey to Mars with arrival expected in 2027.
Learn how to set email reminders on iPhone and Android so you never forget to reply again. Simple built-in features help you stay organized and on top of messages.
Discover how Apple's passkeys revolutionize Mac security by replacing vulnerable passwords with biometric authentication and encryption for ultimate protection.
New survey reveals 78% of parents fear AI scams targeting their kids, yet nearly half haven't discussed these threats. Learn why this dangerous gap exists.
Chrome now autofills passport and driver's license info automatically. Google's latest browser update adds official document support with encryption and user control.
Scammers impersonate Department of Veterans Affairs employees claiming veterans owe money, but real VA communications only direct to VA.gov or official channels.
The AltoVolo Sigma hybrid-electric aircraft flies 500 miles at 220 mph while operating 80% quieter than helicopters, featuring safety systems and compact design.
Google search scam alert: fake customer service numbers can give scammers remote control of your phone. Learn how to spot these traps and protect yourself.
Electric vehicles overtake gas cars in total CO2 savings after just two years of driving, with emissions benefits growing over time as power grids get cleaner.
Louvre Museum reportedly used "Louvre" as password for surveillance system during $100M jewel heist. Learn how weak passwords put even famous institutions at risk.

Server Stats ? Analyzing Traffic To Your Site

Analyzing traffic to a site is a key factor in... Read More

How Worldly is Your World Wide Web?

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

What and How to choose the Right Keywords for Mega Traffic

Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More

Art, Artists and the Web: Part 3--What to Put on an Artist?s Website

What to put your the website if you are an... Read More

Remember This When Building A New Site - Beginners Guide

I recently helped my mom to launch a website (www.mom2me.com)... Read More

The Power Of CPanel

cPanel is a control panel for your website and allows... Read More

Web Sites ? Should I Learn or not?

A common dilemma most small and medium businesses face when... 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

I Want To Be A Freelancer

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

How To Evaluate Your Web Sites Performance

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

Maintaining Your Business Website

QUESTION: Should I build and maintain my business Web... Read More

How To Convert More Sales On Your Website

One of the biggest mistakes that most online retailers make... Read More

Web Design for the Professional Magician Part I - Selecting the Perfect Domain Name

Selecting the Perfect Domain NameThe first issue I have with... Read More

Art, Artists and the Web: Part 4--What to Do After a Website is Designed

What to do if you are an artist after you... Read More

Developing State-enabled Applications With PHP

Installment 1Developing State-enabled Applications With PHPWhen a user is browsing... Read More

Website Globalization

Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More

Website Conversion Rate: More Keywords Equals More Sales

Your website conversion rate should concern you. This simply refers... Read More

Ever Wondered What Challenges Other People With Their Web Site?

Have you ever wondered what challenges are faced by other... Read More

Improving Usability for Screen Reader Users

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

Cost Effective and Powerful Dynamic Websites w. Fantastico Web Hosting

If you are developing your website on a host that... Read More

Your Future Profit Is In The Stars

You don't believe in astrology but you check your horoscope... Read More

Web Content: How Much Should I Pay?

When web content gets discussed on webmaster bulletin boards, the... Read More

Why Local Service Companies Should Have a Website

The Internet is being used by local service business to... Read More

Six Basic Reasons Why Visitors Stay On Your Web Site

1. The first page appears quickly.It's a good way to... Read More

insured cleaning company Morton Grove ..