Changing hosts without editing 450 absolute links

Have about 450 absolute links in various HTML newsletters with “” in the path. We are dumping SiteMason as a host and don’t want to manually change all of those links to “”. After we switch, is there a PHP way to automatically redirect people who click one of those old sitemason links? Any help much appreciated.

There are two ways that should help you out:

PHP redirect:

<?php header( "HTTP/1.1 301 Moved Permanently" ); header( "Location:" ); exit(); ?>


.htaccess redirect:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^$[OR]
RewriteCond %{HTTP_HOST} ^$
RewriteRule ^(.*)$$1 [R=301,L][/php]

Please let me know if this helps you out!

I cannot thank you enough. You have saved me hours of work. Thanks so much!

Sponsor our Newsletter | Privacy Policy | Terms of Service