Posted by J.O. Aho on 06/16/07 14:09
kevgibbo wrote:
> Hi,
>
> I've recently updated a website and I'd like to redirect some ID URL's
> using PHP code, I know how to do the redirect part the problem is the
> if statement to only redirect url's with an id.
>
> for example:
> if domain is www.domain.com do nothing
> but if domain is www.domain.com/?p=12 redirect to www.domain.com
Even if it's possible to redirect pages in php (don't forget to give the
right error code, see other replies in this thread), but it's far better
to do this on the server instead. If you are using apache you can do
this quite gracefully and you won't need a php-redirect-page for each
page you want to have redirected, but use regexpression to pick the
pages you want to be redirected.
--
//Aho
[Back to original message]
|