If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

2 websites 1 domain. redirect without domain replacement

Started by emmawilliam87, Feb 20, 2023, 03:07 AM

Previous topic - Next topic

emmawilliam87Topic starter

The task at hand is to redirect the user from site 1.com to site 2.com without changing the domain name. Essentially, the user should still see site 1.com on their browser while being redirected to site 2.com.

It seems that the individual asking for advice has done something similar in the past but cannot remember how. The issue is that duplicating the site twice is not a desired solution.

To clarify, the main pages of the two sites will be different, but all subsequent pages will be identical. The question is how to execute this redirection without duplicating the site.
  •  


Kitty Solam

The following code contains directives related to ServerAlias or proxying. Within the VirtualHost block, the dоcumentRoot directive specifies the root directory of domain1.local, while the ServerName directive sets the primary name for this server as "domain1.local". The ServerAlias directive creates an alias for this server with the names "domain1.local" and "domain2.local".
  •  

hieronymusf01

To configure an Addon Domain in the Domains section of hosting panels like cPanel or ISPmanager, you need to specify the domain name (e.g. site.com) and insert the NS (Name Server) of the hosting on which the site is located. This configuration will allow your site to open without changing the domain name.

It's important to note that when redirecting, the domain name of the website being visited may change as it redirects to the main domain.
  •  

IdeaPad

One possible solution is to use URL rewriting or reverse proxy techniques to achieve the desired redirection without duplicating the site.

URL rewriting involves configuring the web server to intercept requests for site 1.com and redirect them to site 2.com while still displaying site 1.com in the browser's address bar. The specific steps to implement this may vary depending on the web server software you are using (e.g., Apache, Nginx).

Alternatively, you can set up a reverse proxy server that sits between the user's browser and the two websites. It would receive requests for site 1.com, retrieve the content from site 2.com, and then serve it back to the user while still displaying site 1.com as the domain name. This method requires more advanced server configuration and knowledge of reverse proxies.

Both of these approaches will require some technical expertise and access to server settings or configuration files.
  •  

BemParvefieva

You might consider using a reverse proxy setup. This involves configuring your server to fetch content from site 2.com while presenting it under site 1.com. This way, users remain on site 1.com, but you serve content dynamically from site 2.com. Be cautious, though, as this can introduce complexity in server management and might affect loading times.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...