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.
tidy up service Northbrook ..SiteSpinnerSiteSpinner is a user-friendly web site development tool that includes... Read More
If you are like me you have wanted to build... Read More
If you ever want to create a state directory, article... Read More
Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
1. As the first step, "Hire a web designer."First create... Read More
Building a new website can be a lengthy task. From... Read More
Many small businesses have the misconception that their business can... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
Web templates by nature are created to aid and ease... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
If your company own one or more stores, you might... Read More
"I don't sell anything online, I don't advertise online, in... Read More
Dan Kennedy once said that if you can't make money... Read More
Project Safekids provides webmasters a valuable tool which could save... Read More
You don't believe in astrology but you check your horoscope... Read More
Your site is getting traffic, but conversion rates are horrible.... Read More
Just starting out, you can start with a simple informational... Read More
Everywhere you look these days, people are telling you that... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
If you were asked to put a value on your... Read More
So you've decided to start an online work at home... Read More
URL rewriting are major needs for your sites that produce... Read More
When people think about the Internet, they think about technology.... Read More
From early days of www, the Internet sites that are... Read More
reliable home cleaners Buffalo Grove ..Building a website and getting it online is easy. Driving... Read More
There are several reverse bid freelance sites out there. Beyond... Read More
That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More
If you like the Internet and surfing through the billions... Read More
Many small companies choose not to invest in a professionally... Read More
Every good Internet business understands the value of conversions versus... Read More
If you are like me you have wanted to build... Read More
The Disability Discrimination Act states that service providers must not... Read More
Often time I've browsed sites and seen the same thing... Read More
If you're looking for better web site ROI, chances are,... Read More
I talk with so many people who have small businesses... Read More
While creating a Web site may seem like... Read More
"Don't Sell the Steak, Sell the Sizzle."Have you heard of... Read More
A website is lifeline of internet home business. In order... Read More
1. Be clear on your purpose.Building a website can be... Read More
An interesting eCommerce success factor that isn't precisely overlooked, but... Read More
When web content gets discussed on webmaster bulletin boards, the... Read More
Did you know that hosting companies overcrowd their servers despite... Read More
Do you make your website just to entertain yourself or... Read More
I still remember it very clear ... It was almost... Read More
The first step in setting up an online business...Starting an... Read More
"I am a writer, not a business-person. I don't want... Read More
So you want to take a look at a real... Read More
Have you ever wondered what challenges are faced by other... Read More
Creating and maintaining an effective presence on the Web has... Read More
Web Development |