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.
express cleaning service Arlington Heights ..The big thing these days is your ability to capture... Read More
Web accessibility has so many benefits that I really do... Read More
Many small businesses have the misconception that their business can... Read More
1. Many people are not getting good or complete advice.... Read More
When I set up my website I felt paypal was... Read More
Thousands of people are now making a living online and... Read More
Just starting out, you can start with a simple informational... Read More
Creating and maintaining an effective presence on the Web has... Read More
Building a new website can be a lengthy task. From... Read More
They might not be wearing a mask and carrying a... Read More
While studying online for IT investment opportunities, I found that... Read More
cPanel is a control panel for your website and allows... Read More
August 8 2005, Macromedia announced a release of Studio 8.... Read More
Huge Mistake #1: Creating a Website with Flash -- Did... Read More
More and more non-profit organizations are developing websites to help... Read More
Recently I was reviewing the keyword specific conversion rate data... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
The Internet is being used by local service business to... Read More
The first thing my business consultant (read brother-in-law) asked me,... Read More
"I don't sell anything online, I don't advertise online, in... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
One of the biggest mistakes that most online retailers make... Read More
If you have your own business website and you are... Read More
Internet has opened a whole new world for web developers... Read More
There's been widespread speculation about the new legislation being introduced... Read More
tidy up service Arlington Heights ..One of the best tools you have as a webmaster... Read More
This is a growing concern amongst many business owners. Does... Read More
"How do I improve web site sales figures?" The CEO... Read More
There are several reverse bid freelance sites out there. Beyond... Read More
Web sites are an Ongoing Part of Business.All too many... Read More
A simple website stats counter is not enough if you... Read More
Everywhere you look these days, people are telling you that... Read More
Internet Marketing is not a miracle marketing strategy ? competition... Read More
Now that you have got your domain name registered, your... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
If you are looking for creating your online presence you... Read More
Many small companies choose not to invest in a professionally... Read More
When visitors add your web site to their Favorites or... Read More
An automated accessibility tool is a piece of software which... Read More
Web sites are not just places to sell things; they... Read More
Making a web site is easy. Making a good web... Read More
1. Be clear on your purpose.Building a website can be... Read More
A website is the most versatile and cost-effective marketing tool... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
What is web accessibility & why is it important?Web accessibility... Read More
Making money with your web site is the dream and... Read More
What is CSS?CSS is a simple file which controls the... Read More
When you take a look at the most visited sites... Read More
Starting and maintaining a business is challenging enough without the... Read More
Directory Generator, a product from Armand Morin and Marc Quarles,... Read More
Web Development |