How to point TLD to different TLD sub page

I have got 2 TLD and I want to point one to a sub page of another TLD’s sub page but keep the first TLD name in the browser address bar.

i.e. domainone.com is the main site and domaintwo.com goes to domainone.com/services but shows in the address bar as domaintwo.com

I am not sure how to set this up in Virtualmin i.e. such as using an alias, sub server etc

Howdy,

There’s not really a good way to do that… the recommended ways to handle that would be to either setup domaintwo.com as a Sub-Server, and have it redirect to the URL you want, or to setup your desired page within domaintwo.com.

-Eric

For security reasons, browsers will hopefully not do what applejack wants. :slight_smile: They are supposed to show the actual domain and path that they display, and not some fake or masqueraded one.

To actually pull off what you intend, you’ll need Reverse Proxying in Apache.

Sorry I didn’t really explain very well what I was after.

domaintwo.com would be a Sub-Server I just wanted to know how to direct it to a page of domainone.com as I tried but couldn’t work out how to do it in Virtualmin. As I said it is important that the url in the address bar stays as domaintwo.com.

If you can’t do this in Virtualmin anyone know how to write it for a .htaccess file

Hi,

Are you trying to setup “domain2.com” as an alias of “domain1.com”?

That is, when going to “domain1.com” or “domain2.com” you see the same content?

-Peter

Yes I have set up the domain2.com as an alias and that works but I need it to go to an inner page of the site not the home page.

Hi,

It sounds like you need to “proxy” a request.

You can accomplish this by doing the following:

Setup “domain1.com” as you would normally, and save a file in a directory called “reports” for instance:

So in this example, you’d have:

http://domain1.com/reports/my-report.html

Now, you can setup “domain2.com” and have it point directly to the “reports” directory for instance:

http://domain2.com/my-report.html

This is accomplished by setting up the second domain, then going to:

Virtualmin > Server Configuration > Edit Proxy Website

Let me know if this accomplishes what you desire, and/or if you require any further assistance on the topic.

-Peter

@applejack: I think we did understand what you’re trying to accomplish. :slight_smile:

As I/we said: Generally, it is not possible to have the browser display “domain1”, but show “domain2” in the address bar. It’s a security measure: You want to see and know what page you’re displaying.

There are two ways around that which I know of: first, as I already said, a reverse proxy (for which tpnsolutions explained how to configure it with Virtualmin methods, a clean method), and second making a webpage that loads the actual one in an iframe (rather dirty hack, not recommended).

Question here would be though: WHY would you want to display “domain1” but have “domain2” in the address bar?