[thelist] Handling permanent redirect on IIS with PHP

Clive R Sweeney clive at designshift.com
Wed Mar 8 16:43:17 CST 2006


I have a website that has been redeveloped using PHP. All is going well 
except that there are two files that no longer exist but may be 
bookmarked and are definitely indexed by search engines. The files are 
"default.htm" and "main.html" (Note: in case you're wondering, the 
previous version of the site was all Flash on the page "main.html" which 
appeared in a frame of "default.htm".)

The server is IIS, not Apache. The domain has not changed.

So now I have two new versions of those old pages that use PHP to create 
a permanent redirect as follows:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.THESITENAME.com/");
exit();
?>

This won't quite work yet because the PHP code is on pages without the 
.php extension. My plan is to ask the hosting company to set .htm and 
.html files to be parsed as PHP.

Does this seem to be the correct way of handling the problem? Is there 
anything else I should do? Right now I have a META REFRESH on the two 
redirect pages. Should I get rid of that, so as to avoid being penalized 
by search engines, or is it okay as a temporary measure?

Clive
Durham, North Carolina



More information about the thelist mailing list