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.
Olympia Fields cheap limo service .. Lockport Chicago limo O’Hare"How do I improve web site sales figures?" The CEO... Read More
If you're anything like most small business owners, you probably... Read More
Fresh website content for your visitors can be of real... Read More
1. Upload robots.txt file in to your root directory and... Read More
Your ObjectiveYour small business needs an appealing and professional website... Read More
Website, website, website, everyone says you need one. But do... Read More
Fantastico is a 3rd-party cPanel add-on and can be purchased... Read More
"'Page Not Found' on this Server. Check the URL and... Read More
In about the Time it takes to Watch a Reality... Read More
If you are like me you have wanted to build... Read More
Even with the steady growth of the World Wide Web,... Read More
I talk with so many people who have small businesses... Read More
For years now I've been looking to start my own... Read More
There are millions and millions of websites on the Internet.... Read More
If you ever want to create a state directory, article... Read More
A website lets you put your products in front of... Read More
Customer service questionnaires can help your clients better understand their... Read More
So your prospect, Mary, is sitting at the computer reading... Read More
Build it and they will come is not always true;... Read More
The Internet is a remarkable publishing medium. With just a... Read More
Dance is how you pamper your soul and satiate your... Read More
Making a web site is easy. Making a good web... Read More
One of the things that Internet excels is disseminating information... Read More
Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More
The Internet car buyer is an elusive animal. Trying to... Read More
prom limo Belle Rive ..What to put your the website if you are an... Read More
There is an ongoing debate about web copy. Some say... Read More
So your traffic is going through the roof yeah? It's... Read More
Server Side Includes (SSI) with ASP People often... Read More
Webmasters deal with a myriad of complex design challenges every... Read More
Many executives and investors are skeptical that software products can... Read More
There have been many significant changes to the face of... Read More
There are millions and millions of websites on the Internet.... Read More
You don't believe in astrology but you check your horoscope... Read More
If one more business owner tells me their website sucks... Read More
It may seem like the publishing industry's equivalent of Beanie... Read More
Internet has opened a whole new world for web developers... Read More
Just like all things in life, the ways to run... Read More
When we review the sites of potential clients, there are... Read More
August 8 2005, Macromedia announced a release of Studio 8.... Read More
When a user signs up at your website, you may... Read More
It amazes me how many people try to build serious... Read More
Research reveals three important facts:1) The Internet is one of... Read More
What is the point of having a website, you may... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
1. Be clear on your purpose.Building a website can be... Read More
Visitors to your site come looking for information or solutions... Read More
An automated accessibility tool is a piece of software which... Read More
So you have a good idea for a business and... Read More
More and more businesses are recognizing the importance of content... Read More
Web Development |