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.
Lincolnshire shuttle from Midway .. Lockport Chicago limo O’Hare"I have a small business with just a couple of... Read More
Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More
I'm a freelance programmer and somehow I managed to get... Read More
Are you aware that 90% of the websites on the... Read More
Below, I have listed 8 simple steps that you can... Read More
There are hundreds of millions of Web surfers today. Each... Read More
Creatively marketing your corporate site takes time in the set... Read More
You have permission to publish this article electronically, in print,... Read More
Here's something you may never have thought of before:If I... Read More
1) Word of Mouth The single most powerful form of... Read More
Often time I've browsed sites and seen the same thing... Read More
So your traffic is going through the roof yeah? It's... Read More
Rosalind wants to share her inspirational poetry with a wider... Read More
The first thing my business consultant (read brother-in-law) asked me,... Read More
While studying online for IT investment opportunities, I found that... Read More
Designing an E-commerce Web site is not as simple as... Read More
Just like all things in life, the ways to run... Read More
In the big, wide online world there are millions of... Read More
I recently received an unsolicited e-mail from some company offering... Read More
If you're anything like most small business owners, you probably... Read More
The evolution of web development parallels the model of technology... Read More
Psychology is a long word which everyone thinks, "no, that's... Read More
You want to give your site's visitors a way to... Read More
I've heard several prominent web marketers mention in their classes... Read More
We are clearly well past the innocent "golden age" of... Read More
Algonquin limo Chicago ..An automated accessibility tool is a piece of software which... Read More
Developing a website with content that entices visitors to return... Read More
Every good Internet business understands the value of conversions versus... Read More
How many Web Sites did you stumble over telling you... Read More
Creatively marketing your corporate site takes time in the set... Read More
Many small companies choose not to invest in a professionally... Read More
When marketing your website, it's important to know which of... Read More
So your traffic is going through the roof yeah? It's... Read More
In the late 1990's three San Francisco based web developers... Read More
Designing an E-commerce Web site is not as simple as... Read More
What is web accessibility & why is it important?Web accessibility... Read More
Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More
Recently, a friend asked "What's the deal with those DIY... Read More
Making maximum profit from your law firm website is important,... Read More
If one more business owner tells me their website sucks... Read More
In this day and age most businesses consider having their... Read More
Does your website have a links/resources page?Do you exchange reciprocal... Read More
Does My Web Site Require A Web Database?If your web... Read More
Let's begin by setting some limits. If you're like me,... Read More
Everywhere you look these days, people are telling you that... Read More
Q. Hey, Cathy: I'm just setting up a website. What... Read More
When a user signs up at your website, you may... Read More
You work hard to build traffic to your web page.... Read More
There are lots of HTML editors on the market, however,... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
Web Development |