Domain Forwarding Question

Associate
Joined
28 Dec 2002
Posts
2,400
Location
Northern Ireland
Hi Guys,
I have two domains

www.curbsportadown.co.uk - Main
www.curbsproject.co.uk

At present I have the the Main Domain set to forward to the curbsproject.co.uk domain, which when done will display the curbsproject.co.uk domain name in the address bar. However our client wants both sites to mirror each other and have their own domain names displayed in the address bar!

So no matter what domain name is used both websites will show the same information and reflect changes.

Not sure how to go about doing this so any help is much appreciated.
 
Soldato
Joined
9 Mar 2010
Posts
2,841
This pretty much goes against all best practices and could negatively effect the search ranking and ratings for your website.

However, if you want to do it is possible with framed redirects.

Depending on your domain registrar they might have the option for you otherwise check here how to create the same effect manually.

http://en.wikipedia.org/wiki/URL_redirection#Frame_redirects - This has MANY drawbacks such as the URL not changing as you navigate through the website.

This is if you want to display the exact same website. The other alternative I suppose is totally recreating and hosting it twice. Again, typically very bad practice.

EDIT: I think possibly what you might want to get back to them with is reasons NOT to do this... such as the negative effect it has on user experiences (with framed redirects), on search rankings (search for "content duplication"), or increased costs by having to host it twice for the same content (then obviously the problem with keeping them both up to date! - probably not a problem with a sensible CMS)
 
Last edited:
Soldato
Joined
5 Dec 2006
Posts
15,370
Does the hosting use cPanel?

Log in
Go to "Parked Domains"
Type in the domain name and hit "add domain"

Sorted. (You'll have to set up the new domain's nameservers to point to the hosting if you haven't done so already)
 

Pho

Pho

Soldato
Joined
18 Oct 2002
Posts
9,325
Location
Derbyshire
You could use the canonical tag. See Google's blog.

So you'd define one site to be the "master" site, and then add canonical links on the other pointing to the master site's URL for the same page.

Can rel=”canonical” be used to suggest a canonical url on a completely different domain?

There are situations where it’s not easily possible to set up redirects. This could be the case when you need to migrate to a new domain name using a web server that cannot create server-side redirects. In this case, you can use the rel=”canonical” link element to specify the exact URL of the domain preferred for indexing. While the rel=”canonical” link element is seen as a hint and not an absolute directive, we do try to follow it where possible.

http://searchengineland.com/google-supports-cross-domain-canonical-tag-32044



If you're using PHP/.NET etc you could be sneaky and check the host header (so you know if someone's accessing the .co.uk or .com version). If they're not accessing the master site then add the canonical tag.

Here's a quick function I wrote to generate your canonical URL from the current address:
PHP:
<?php
function getMasterUrl ($masterHost = "www.example.com"){
	// http://www.phpf1.com/tutorial/get-current-page-url.html
	$protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https';
	//$host		= $_SERVER['HTTP_HOST'];
	$host		= $masterHost;
	$script		= $_SERVER['SCRIPT_NAME'];
	$params 	= $_SERVER['QUERY_STRING'];
	$hasParams	= !empty($params);
	$masterUrl 	= $protocol . '://' . $host . $script . ($hasParams ? '?' . $params : '');
	
	return $masterUrl;
}

$masterUrl = getMasterUrl();
$masterUrlSpecified = getMasterUrl("www.example.org");
?>

<h1>Master URL (auto):</h1>
<p><a href="<?php echo $masterUrl; ?>"><?php echo $masterUrl; ?></a>

<h1>Master URL (specified):</h1>
<p><a href="<?php echo $masterUrlSpecified; ?>"><?php echo $masterUrlSpecified; ?></a>
Demo: http://phpfiddle.org/main/code/b1t-u5h (hit run)



Also, as long as your site links don't hard-code to the .co.uk or .com URL there's nothing stopping you from setting up a symbolic link on your hosting (assuming you're running Linux with SSH enabled in your control panel) which would point both site's content to the same path on the server, meaning you only need to update one site. Theoretically (untested) :p.
 
Back
Top Bottom