Here is my issue in a nutshell. I have 2 domain names:
www.aacorvette.com is the primary
www.aandacorvette.com is the secondary and setup as a domain alias
I have an SSL for www.aacorvette.com and only want to use that one.
Right now I have this to check and see if the URL is aacorvette or aandacorvette and redirect if incorrect.
This seems to work OK, but if the user has http://aacorvette.com in the bar, it will forward them to the www.aacorvette.com address. (not that big of a deal)PHP Code:
<?
$aa = 'www.aacorvette.com';
$url = $_SERVER['SERVER_NAME'];
if ($url != $aa)
{
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www.aacorvette.com');
}
?>
I tried to find a funtion that would use a "contains string in variable" but I couldn't find a good way.
Is this the best way to do this? If so, is the best place to put the code in the tpl_main_page.php file?
Thanks!
Steve
Bookmarks