[kdewebdev-site] HTML->PHP
Chris Martin
linux at chriscodes.com
Thu Feb 24 09:19:59 EST 2005
Joff wrote:
> On Thursday 24 February 2005 10:49, Andras Mantia wrote:
>
>>On Thursday 24 February 2005 12:40, Joff wrote:
>>
>>>turn the old page into a blank page with a meta refresh in the head
>>>(the latter is better for search engines as they /should/ update your
>>>listing in them with the new link)
>>>
>>>ideally, there should be a 301 redirect (permanently moved) header
>>>
>>>:):)
>>
>>Can you give some examples with such "redirecting" files?
>
>
> <?php
> header("HTTP/1.1 301 moved permanently");
> header ("Location: http://www.uri-here.com");
> header("Connection: close");
> ?>
>
> or
>
> <meta http-equiv='refresh' content='0;URL=http://www.uri-here.com' />
> in the head of an html page, where '0' is the number of seconds delay before
> redirecting to the new page
>
> or
>
> Redirect permanent /index.html /index.php
>
> in the .htaccess
>
> Joff
IMO I prefer to use .htaccess
This way I have a list of pages that have been moved that helps to
verify that SE's are finding the new pages. And the old file can be
deleted. Last thing I need is index.php, index.html, index.htm, etc.
I wouldn't suggest meta refresh unless it's the only option (obviously
not the case). I've heard that SE's don't like refreshing pages too
well. The key is to send the 301 header so they know it's moved.
While we're on the subject, what about just "future proofing" the urls
with directory indexes, or mod_rewrite?
This would be done easiest by moving /about.html to /about/
By dropping the extension, if it's ever changed down the line, your
url's will remain the same across your code, and sites that link to you.
--
Chris Martin
Web Developer
Open Source & Web Standards Advocate
http://www.chriscodes.com/
More information about the kdewebdev-site
mailing list