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.
maid service near Lake Forest ..Below, I have listed 8 simple steps that you can... Read More
One of my most salient memories from when I sold... Read More
Setting up a website is the very first step of... Read More
A website provides invaluable advantages for businesses who have one.7... Read More
A website lets you put your products in front of... Read More
Conceptualize, Build and Publish a Web site - What's required... Read More
1. Upload robots.txt file in to your root directory and... Read More
Simply ensuring your website is accessible to screen reader users... Read More
Many of site owners still don't realize all advantages of... Read More
Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More
What is the point of having a website, you may... Read More
A PHP Redirect automatically transfers a web user from one... Read More
There are millions and millions of websites on the Internet.... Read More
If you don't have a web site yet, are thinking... Read More
The internet has taken over our lives with a vengeance,... Read More
One of the biggest mistakes that most online retailers make... Read More
While studying online for IT investment opportunities, I found that... Read More
Web templates by nature are created to aid and ease... Read More
Thousands of people are now making a living online and... Read More
It may come as some surprise to a traditionally off-line... Read More
Web accessibility has so many benefits that I really do... Read More
While it may seem like a "quick and easy" task,... Read More
There are lots of HTML editors on the market, however,... Read More
Many small companies choose not to invest in a professionally... Read More
I recently received an unsolicited e-mail from some company offering... Read More
top rated cleaning service Des Plaines ..How can we add Word Rich Content to our Websites... Read More
Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More
There is an ongoing debate about web copy. Some say... Read More
Developing a website with content that entices visitors to return... Read More
When building a relationship, listening is more important than talking.A... Read More
When you consider the billions of individuals and companies on... Read More
Fresh website content for your visitors can be of real... Read More
Are bloated images slowing down your web site and causing... Read More
Having an eye catching website is great, but are you... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
What is the most important part of your online business?Many... Read More
Visitors to your site come looking for information or solutions... Read More
Every business needs to know how it is doing. That's... Read More
Running an effective website is a continuous process. I have... Read More
1) A marketing necessityI still hear it said from time... Read More
I recently helped my mom to launch a website (www.mom2me.com)... Read More
Creating and maintaining an effective presence on the Web has... Read More
Right after the thought, "I need a website," people usually... Read More
Are you, like many other website owners, frustrated at the... Read More
Most people know they need a website in order to... Read More
The first thing my business consultant (read brother-in-law) asked me,... Read More
How many Web Sites did you stumble over telling you... Read More
Your site is fast and getting traffic, but conversion rates... Read More
1. Many people are not getting good or complete advice.... Read More
If your company own one or more stores, you might... Read More
Web Development |