2

I have a website hosted at (for example) website.com. The thing is, I also have my own server and a different domain name registered with a different company.

Let's say I own example.com and it points to my own server. When a user visits example.com I want them to see what is displayed at website.com. As much as possible, I want them to see website.com while the address bar says example.com.

I have full access to example.com but I only have access to the content being displayed at website.com. I can do a redirect from example.com to website.com but that is not what I want. I can also just use an iframe at example.com but I was wondering if there is a better way to do this.

2
  • 2
    What is your primary reason for wanting the same content displayed on two domains? There are negative repercussions for doing this.
    – John Conde
    Commented Jun 20, 2014 at 18:43
  • @JohnConde I have my main content at website.com. I am unable to import this content from website.com to example.com, but I do have control over the content (and only the content) at website.com. example.com is my preferred URL and I would always want to use it. I guess using a redirect or somehow getting control over example.com and its content is the best solution. Commented Sep 8, 2014 at 20:33

2 Answers 2

1

Firstly, you need to know that duplicate content will negatively affect your search rankings. To avoid such an issue, you will need to look into using canonical URLs on the domain that is of lesser importance to you. That way, you're letting Google know that example.com is a feed for website.com.

In regards to the display of content, you could go down the route of using an iframe. In fact, a lot of websites do this.

If an iframe isn't your cup of tea, then you could look into setting up some sort of proxy, where example.com uses a script to scrape website.com for its content. For example: You could use a cURL-driven script on example.com to GET and then cache the content from website.com for a certain period of them. Obviously, this is a little more complex than simply displaying website.com inside an iframe, as you will need to cache the results and modify relative URLs, forms, images and social media plugins etc.

0

I stumbled across this question because I have two domains displaying identical content, and I need to make one direct to the other DNS rather than share content.

I will answer this question by stating my current problem, as it seems that my problem is a solution to this question.

I have virtual hosts set up on one VPS, my httpd.conf file located at /etc/httpd/conf/httpd.conf on my server. If you don't know where it is on yours and that is not it, type # httpd -V in the terminal. This page explains in more detail. Notice the line in red, and the bolded line at the bottom.

-D HTTPD_ROOT="/etc/httpd" and -D SERVER_CONFIG_FILE="conf/httpd.conf"

Put them together and you get the location. /etc/httpd/conf/httpd.conf

This is my httpd.conf's contents at the virtual hosts.

NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/com/me
ServerName ryan-mortensen.me
ServerAlias *.ryan-mortensen.me
</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/com/unipartisan
ServerName unipartisan.com
ServerAlias unipartisan.org
</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/com/mortensenmotors
Servername mortensenmotors.com
</VirtualHost>

I am hosting three web sites on this server. Notice the one in the middle, unipartisan.com. It has a server alias unipartisan.org which is also registered to me and pointed at the server in its DNS zone file.

In this configuration, if I type unipartisan.com, the page loads and the nomenclature of the .com is persistent. Likewise, if I type unipartisan.org the url continues to read .org as I go page to page.

While I find this an inconvenience I am to shortly resolve, this would do what you want.

1
  • If anyone is curious, the way I fixed this was to remove ServerAlias unipartisan.org from the respective virtual host. Then I made the .org its own <VirtualHost *:80> block with a DocumentRoot /var/www/html/com Then I placed an index.php file in the /com directory with <?php header('Location: unipartisan.com'); exit(); ?> Commented Mar 24, 2015 at 6:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.