Mobile app version of vmapp.org
Login or Join
Gloria169

: Displaying website hosted at one domain on a different domain 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

@Gloria169

Posted in: #Iframe #MultipleDomains #Redirects

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.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Gloria169

2 Comments

Sorted by latest first Latest Oldest Best

 

@Murray155

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 Ryan@Ryan-Mortensen.me
DocumentRoot /var/www/html/com/me
ServerName ryan-mortensen.me
ServerAlias *.ryan-mortensen.me
</VirtualHost>

<VirtualHost *:80>
ServerAdmin Support@Unipartisan.com
DocumentRoot /var/www/html/com/unipartisan
ServerName unipartisan.com
ServerAlias unipartisan.org
</VirtualHost>

<VirtualHost *:80>
ServerAdmin Ryan@Ryan-Mortensen.me
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.

10% popularity Vote Up Vote Down


 

@Shelton105

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme