News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
How to Avoid 404s and Redirect Old URLs in PHP
August 03, 2010 @ 14:15:27

On the SitePoint PHP blog today there's a new post showing you how to create a 404 page that will redirect people back to the page they're looking for (that used to be there).

It's often necessary to reorganize your site and change the URL structure but, assuming you have similar content, users should rarely encounter a "page not found" error. Producing unnecessary 404 pages is one of my top 10 development mistakes. In this article, we'll create an automated PHP redirection system that converts old URLs to a new address. It's not production code, but it will illustrate the basics so that you can adapt it for your own website.

They walk you through the creation of a 404 error handling PHP page, configuring your server to use it and making the mapping of new URL to old URL. There's even a bit to include if there's not a mapping for a requested page - returning a 301 HTTP header.

0 comments voice your opinion now!
404 redirect map url tutorial


blog comments powered by Disqus

Similar Posts

phpPatterns.com: Creating XUL applications with PHP

Artur Ejsmont's Blog: How to build mongodb pecl extension in 32bit for PHP 5.2 on OSX Snow Leaopard

DevShed: Using Recursive Methods in Object-based PHP Applications (Part 2)

Script-Tutorials.com: How to Protect any Site from Spam using Akismet

Chronosight Blog: Inline AJAX Calendar using PHP


Community Events





Don't see your event here?
Let us know!


install community series laravel framework language introduction developer wordpress interview podcast api bugfix threedevsandamaybe application list library release code configure

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework