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.

kitchen deep cleaning Deerfield ..
In The News:

Unlike robotaxi competitors, Tensor focuses on consumer-owned self-driving cars that adapt to highways and urban roads with full redundancy systems for safety.
Medicare scams cost $54 billion in 2024 as fraudsters target beneficiaries with fake calls demanding payments and personal information to steal benefits.
Scammers create fake Evite invitations that mimic legitimate event emails, requiring users to verify senders and use antivirus software for protection.
The new Apple Watch hypertension feature passively monitors blood pressure patterns over 30 days using sensors to detect chronic high blood pressure signs.
Chrome extension spyware disguised as a free VPN service highlights security risks after it captured private browsing data from trusted sites.
New research shows how fatty acids in cooking oil can safely dissolve and recover silver from circuit boards without harmful chemicals or environmental damage.
The Fox News AI newsletter gives you information on the latest AI technology advancements, and about the challenges and opportunities AI presents now and for the future.
Anthropic investigates alarming AI abuse case where hacker automated entire cybercrime campaign using Claude, stealing sensitive data from defense and healthcare firms.
TikTok, Meta and YouTube restrict Charlie Kirk shooting videos with age gates and warnings while X faces criticism for allowing continued circulation.
Cybercriminals use fake troubleshooting websites to trick Mac users into running terminal commands that install Shamos malware through ClickFix tactics.
San Francisco startup Fable launches Showrunner, an AI platform dubbed the 'Netflix of AI' that generates animated episodes from text descriptions with Amazon support.
Apple raised iPhone prices for some models despite receiving tariff relief from President Donald Trump, with the new lineup starting at $799 for the base model.
A two-story 3D concrete printed home in Western Australia demonstrates faster construction methods that could reshape American housing amid rising costs.
Credit scores remain important during retirement for insurance rates and housing applications, while seniors become prime targets for identity theft and financial scams.
Scammers now send unexpected packages with QR codes that redirect victims to fraudulent websites or download malicious software to steal sensitive information.
Meeting AI tools record private conversations alongside work discussions, creating privacy risks that can be managed with proper settings and awareness.
Hotel privacy concerns are valid but rare, with methods to detect hidden tech using smartphone flashlights, mirror tests and scanning apps.
Improve your Wi-Fi speed and reliability with 10 simple router optimization tips that don't require special apps or expensive subscriptions.
A Columbia University breach exposed names, Social Security numbers and academic records of nearly 869,000 people, with notifications beginning in August.
Rental car drivers use AI-powered apps like Proofr to protect themselves from unfair damage fees as major companies deploy automated inspection tools.
Fox News' AI newsletter brings you the latest on technology advancements around artificial intelligence.
OnTrac data breach between April 13-15, 2025, exposed personal information of over 40,000 people including Social Security numbers and medical records.
A woman named Wika announces her engagement to an AI chatbot sparking worldwide debate about virtual relationships and technology.
The notorious people search site National Public Data relaunches despite a previous breach affecting 3 billion individuals, raising fresh privacy concerns.
Revolutionary TRAUMAGEL gel controls life-threatening bleeding from gunshot wounds and traumatic injuries, helping first responders prevent prehospital deaths.

The 2 Most Common Web Site Mistakes

When we review the sites of potential clients, there are... Read More

Why do I Need a Website?

Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More

Web accessibility for screen magnifier users

The needs of screen magnifier users are overlooked when implementing... Read More

Topics to Add When Creating an Alternate and Modern Medicine Web Directory

Alternate medicine finds its own place in the hearts and... Read More

Build or Buy a CMS?

Creating a content management system either from scratch,... Read More

The Problem with Automated Accessibility Testing Tools

An automated accessibility tool is a piece of software which... Read More

Successful Web Development: 10 Key Elements

There are many elements that are key to successful web... Read More

Allocating Your Web Site?s Budget Properly

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

35% Revenue Increase? from Your Website!

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

You May Be Losing Valuable Traffic - And Not Even Know It!

Here's something you may never have thought of before:If I... Read More

HTML Editors - How to Choose the Right One for Building Your Websites

There are lots of HTML editors on the market, however,... Read More

A Website Is Not Enough

Your ObjectiveYour small business needs an appealing and professional website... Read More

You Dont Know Which One

I still remember it very clear ... It was almost... Read More

Duplication vs. Individualism

How can we add Word Rich Content to our Websites... Read More

How to Draw Icons or Images on a Mapserver Generated Map

In this example I have used the map of the... Read More

In Business? 10 Reasons Why You Need a Website -- Now!

1) Word of Mouth The single most powerful form of... 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

Where?s Your Web Site?

This simple question can take on several different forms, but... Read More

Why Do I Need A Web Site?

Even though the Internet has been around for a long... Read More

How to Build a Database Driven Web Site

If you ever want to create a state directory, article... Read More

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

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

I Want To Be A Freelancer

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

Do Dancers Need A Website?

Dance is how you pamper your soul and satiate your... Read More

A Web Site for Your Small Business: How to Set Up a Website

Your web site will be your window to the world.... Read More

You Don?t Have to be Amazon.com to Achieve 12% Conversion Rates!

That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More

interior house cleaning Highland Park ..