Need to show contents domain a (external) under domain b. How?

tlweb

Verified User
Joined
Feb 23, 2015
Messages
36
Location
Netherlands
Hi,

I have a domain on my directadmin server lets say domainb.com. Now my client asked me if this domainb.com could show contents of a certain url for instance domaina.com/promotion. How can i achieve this?

My server setup is nginx_apache.
I tried with htaccess using the [p] flag but that throws server errors.

I wonder if maybe i could turn nginx standalone on and use some custom things in that domains nginx conf file? But my knowledge just lacks too much in this department to fully implement this.

I hope someone can point me in the right direction.

Thanks in advance!
 
This should help you (you will have to change according to your wishes):

1. Login as an Admin into your server.
2. Go to Server Manager --> Custom HTTPD Configurations
3. Look for the domain you want to change the docroot for.
4. Click on httpd.conf
5. Click up right on CUSTOMIZE
6. under "httpd.conf customization for LARAVEL_DOMAIN" add the following line:
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html/public|
7. click on the SAVE button on the bottom right.

But both domains NEED to be on the same server for this.
 
Last edited:
Hi, thanks for responding but the domaina.com/promotion is hosted externally. Not on the same server.
 
Does your domain need to keep saying domainb.com? or is it okay to say domaina.com/promotion
 
Not sure but put this in a htaccess file:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^old-domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.old-domain.com$
RewriteRule (.*)$ http://www.new-domain.com/$1 [R=301,L]

This code will redirect all traffic from the old-domain.com to the new-domain.com without changing the URL in the browser. The “R=301” flag indicates a permanent redirect, and the “L” flag indicates that no other rules should be processed after this one.

More info:
 
Back
Top