You are here: Re: [PHP] Question about HTTP 301 permanent redirects « PHP « IT news, forums, messages
Re: [PHP] Question about HTTP 301 permanent redirects

Posted by Kevin L'Huillier on 06/28/05 08:11

On 27/06/05, Dr. Brad Lustick <sales@backbenimble.com> wrote:
> I'm a novice trying to understand the exact construction of code for doing an HTTP 301 permanent redirect for a server
> coded in PHP. Could someone please tell me how I would handle the following example?
>
> http://www.nimblepedic.com/services-bodytools.php?i=bodytools
>
> WANT TO DO A HTTP 301 REDIRECT TO:
> http://www.nimblepedic.com/services.php/body_tools

There are a few examples at http://php.net/header

In your case you might want to do something like:

$article = $_REQUEST['i'];
// some validation of $article if necessary
$url = sprintf('/services.php/%s'. $i);
header('Location: ' . $url);

(Also, that's a hell of a signature.)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация