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.
whole house cleaning Deerfield ..Creatively marketing your corporate site takes time in the set... Read More
A simple website stats counter is not enough if you... Read More
cPanel is a control panel for your website and allows... Read More
Through the explosive growth of the Web, companies have realized... Read More
You have permission to publish this article electronically, in print,... Read More
The Internet is a remarkable publishing medium. With just a... Read More
While studying online for IT investment opportunities, I found that... Read More
You hear a great deal about the Internet these days... Read More
When building a relationship, listening is more important than talking.A... Read More
The first step in setting up an online business...Starting an... Read More
A website is like an information flow, with you as... Read More
Are bloated images slowing down your web site and causing... Read More
Failure, just like success, is measured differently by each and... Read More
Losing website sales and traffic is sometimes simply a case... Read More
Why do some sites succeed while the vast majority of... Read More
In 1995 a new era of accessibility for disabled people... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
Even though the Internet has been around for a long... Read More
Before you start building your site, ask yourself "WHY?". Why... Read More
Like any area of business your website needs some effort... Read More
Profiles are one of the best kept secrets around regarding... Read More
What is the most important part of your online business?Many... Read More
The DDA (Disability Discrimination Act) states that service providers must... Read More
That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More
Like wine cars get more attractive to collectors as years... Read More
home cleaning services Des Plaines ..The internet has taken over our lives with a vengeance,... Read More
Writing for the web is totally different to writing for... Read More
Does your website have a links/resources page?Do you exchange reciprocal... Read More
Thinking about starting up a business? The web is the... Read More
I recently received an unsolicited e-mail from some company offering... Read More
Creating and maintaining an effective presence on the Web has... Read More
Just like all things in life, the ways to run... Read More
Understanding and using web analytics.In recent years, website marketers were... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
It may come as some surprise to a traditionally off-line... Read More
While creating a Web site may seem like... Read More
Even though the Internet has been around for a long... Read More
More and more non-profit organizations are developing websites to help... Read More
In this example I have used the map of the... Read More
When web content gets discussed on webmaster bulletin boards, the... Read More
1) A marketing necessityI still hear it said from time... Read More
Do you need a web site? Are you considering getting... Read More
I'm one of those people that always wanted a website,... Read More
Most interactive websites nowadays would require a user to log... Read More
Failure, just like success, is measured differently by each and... Read More
Your ObjectiveYour small business needs an appealing and professional website... Read More
We are clearly well past the innocent "golden age" of... Read More
It amazes me how many people try to build serious... Read More
Functions and Subroutines in ASP If you read... Read More
There are many elements that are key to successful web... Read More
Web Development |