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 ..Project Safekids provides webmasters a valuable tool which could save... Read More
A lot of people these days are interested in getting... Read More
Just starting out, you can start with a simple informational... Read More
1) Word of Mouth The single most powerful form of... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
Go to any internet marketing forum you want these days... Read More
If your company own one or more stores, you might... Read More
It may seem like the publishing industry's equivalent of Beanie... Read More
The internet is a sea of knowledge. Getting your information... Read More
One of the things that Internet excels is disseminating information... Read More
I still remember it very clear ... It was almost... Read More
Why do some sites succeed while the vast majority of... Read More
Do you make your website just to entertain yourself or... Read More
We've all seen those messages on some websites warning not... Read More
Below, I have listed 8 simple steps that you can... Read More
Why do some web sites reap huge benefits while others... Read More
Everywhere you look these days, people are telling you that... Read More
The internet has taken over our lives with a vengeance,... Read More
QUESTION: Should I build and maintain my business Web... Read More
1. Many people are not getting good or complete advice.... Read More
Your business website is a critical aspect of being able... Read More
The following is a list of patterns that many visitors... Read More
Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More
Your website conversion rate should concern you. This simply refers... Read More
When you consider the billions of individuals and companies on... Read More
tidy up service Arlington Heights ..If you're fairly new to the Internet scene, you may... Read More
That's right. Your method, behavior and strategy you are now... Read More
The growth in Internet usage around the world is astounding... Read More
You've just finished congratulating your marketing team. After six months... Read More
Analyzing traffic to a site is a key factor in... Read More
A company must earn and keep trust or sales don't... Read More
80% of your Web site is Maintenance!Once your Web site... Read More
The needs of screen magnifier users are overlooked when implementing... Read More
If your company own one or more stores, you might... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
The Internet car buyer is an elusive animal. Trying to... Read More
Huge Mistake #1: Creating a Website with Flash -- Did... Read More
Any new website competing on the internet, needs to take... Read More
Thousands of people are now making a living online and... Read More
The DDA (Disability Discrimination Act) states that service providers must... Read More
So you have decided that you want to do freelance... Read More
There are millions and millions of websites on the Internet.... Read More
What is SQL? SQL stands for Structured Query Language and... Read More
An additional benefit of website accessibility is an improved performance... Read More
"Build it and they will come."--Filed of Dreams (1989) If... Read More
Whether you have your own business already, or are looking... Read More
Recently, a friend asked "What's the deal with those DIY... Read More
Spend time planning your Web site. Before you design a... Read More
When web content gets discussed on webmaster bulletin boards, the... Read More
Appealing to others is really important when you have a... Read More
Web Development |