Web Development Information

PHP Redirect


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.


MORE RESOURCES:

Custom Website Design Tips for Search Engine Friendly Web Development
PRLog.Org (press release), Romania - 6 hours ago
PRLog (Press Release) – Oct 14, 2008 – Website Design is the important part of the website programming development. You can find out here some useful tips ...


Revamp of IT Chimes a Website Design, Web Development and SEO ...
Live-PR.com (Pressemitteilung), Austria - Oct 14, 2008
IT Chimes a web development company, develops, integrates and maintain web applications and custom applications. IT Chimes is your one stop IT solutions ...


WhiteHat Security Enhances Education Services Division to Address ...
Earthtimes (press release), UK - Oct 14, 2008
Industry-leading Training Program Expands Existing Course Content and Adds .Net Security Class SANTA CLARA, Calif., Oct. 14 SANTA CLARA, Calif. , Oct. 14 ...


Job vacancy: Web Development Officer
PublicTechnology.net, UK - Oct 13, 2008
This is a role for someone with experience in both web development work and supporting users on web related issues. It will suit someone with two year’s ...


Senior Technical SEO Developer
Bizcommunity.com, South Africa - 6 hours ago
Must also have a strong understanding of both web development and SEO. A proven track record in an SEO focused web development capability is required along ...


Mozilla Labs pursues Web development tools
Computerworld, MA - Oct 14, 2008
By Paul Krill October 14, 2008 (InfoWorld) Dissatisfied with the Web development tools already available, researchers at the newly formed Developer Tools ...


BrowserMedia Wins Ten W3 Awards in 2008
MarketWatch - 1 hour ago
BrowserMedia is a leading interactive web development and Internet software company. Since 1998, more than 230 commercial, association, and non-profit ...


Newly PMP Certified Luxerge, LLC Launches Enhanced Website to Help ...
PR Web (press release), WA - 3 hours ago
For companies whose fortunes and reputations ride on web development projects, anything less than an expert project manager will simply not do. ...


Coding moves with the times
Computing, UK - 10 hours ago
The impact of open-source development frameworks can be most clearly seen in the field of web development, where frameworks such as Ruby on Rails have ...


New Athletic Hall of Fame members sought
Chetek Alert,  United States - 3 minutes ago
Wisconsin Athletic Hall of Fame members must have made a significant contribution or compiled a record of achievement in a sport that has benefited or ...

Web-Development - Google News

home | site map
© 2006