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.
one time home cleaning Highland Park ..Many small companies choose not to invest in a professionally... Read More
Like any area of business your website needs some effort... Read More
Optimal website design is the art of logical navigation.It will... Read More
A simple website stats counter is not enough if you... Read More
You want to give your site's visitors a way to... Read More
It amazes me how many people try to build serious... Read More
Your content is what gets you in search engines, speaks... Read More
A lot of people these days are interested in getting... Read More
What happened on your website yesterday? What about last week... Read More
Developing a website with content that entices visitors to return... Read More
While it may seem like a "quick and easy" task,... Read More
"If you build it, they will come"; is an age... Read More
Every small business owner knows that they need a website,... Read More
QUESTION: Should I build and maintain my business Web... Read More
Why do some web sites reap huge benefits while others... Read More
Running an effective website is a continuous process. I have... Read More
Everyone wants one.Everyone wishes they knew how to make one.SOME... Read More
The following is a list of patterns that many visitors... Read More
What to do if you are an artist after you... Read More
Looks like every client wants a Flash site these days... Read More
Now that you have got your domain name registered, your... Read More
I've heard several prominent web marketers mention in their classes... Read More
One of the most important parts of establishing a new... Read More
More and more non-profit organizations are developing websites to help... Read More
The Internet has opened a whole New World of opportunity... Read More
licensed cleaning services Park Ridge ..To the starting internet entrepreneur, there is nothing more discouraging... Read More
If you're looking for better web site ROI, chances are,... Read More
For years now I've been looking to start my own... Read More
How do you decide on the content, products and or... Read More
Build it and they will come is not always true;... Read More
Whether you have your own business already, or are looking... Read More
When most people build a web site, they think one... Read More
Web templates by nature are created to aid and ease... Read More
80% of your Web site is Maintenance!Once your Web site... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
As increasing numbers of people search for information on the... Read More
This is a growing concern amongst many business owners. Does... Read More
First, an eye opener. Making your fortune through affiliate programs... Read More
Huge Mistake #1: Creating a Website with Flash -- Did... Read More
Alternate medicine finds its own place in the hearts and... Read More
So your prospect, Mary, is sitting at the computer reading... Read More
I'm one of those people that always wanted a website,... Read More
So you have a good idea for a business and... Read More
Spend time planning your Web site. Before you design a... Read More
1) Word of Mouth The single most powerful form of... Read More
Many executives and investors are skeptical that software products can... Read More
Designing an E-commerce Web site is not as simple as... Read More
Does your website have a links/resources page?Do you exchange reciprocal... Read More
If you have some experience in web site design and... Read More
If you are developing your website on a host that... Read More
Web Development |