I have a website hosted with a domain (www.example1.com).
When viewers access this website, I want everything to remain exactly as is however, I want to change the URL in the browser to appear as www.example2.com.
Is this possible?
I have a website hosted with a domain (www.example1.com).
When viewers access this website, I want everything to remain exactly as is however, I want to change the URL in the browser to appear as www.example2.com.
Is this possible?
"When viewers access this website, I want everything to remain exactly as is however, I want to change the URL in the browser to appear as www.example2.com."
No, you can't do this with Chrome, Edge, IE, Firefox, etc. because they don't want to let you impersonate apple.com or microsoft.com etc.
You can only do the reverse: have your example1.com URL be visible while you display content from example2. This could be done with tricks like an iframe or fetching the content server-side with cURL.
If you want to hide the URL for example1.com you'll need to make your own browser using a chromium widget, the IE web control, webkit. If it's your own browser you can display anything you want in the address bar or show no address bar at all.
You can try the following:
example1.com
and example2.com
.example2.com
should point to the IP of the server hosting your web app In your name server configuration.example1.com
should be configured to forward to example2.com
(also from the name server).So, visitors to example1.com
will be redirected to example2.com
and see the content of the web app while the address bar remains pointing to example1.com
.
Another solution:
example2.com
only if the request was for example1.com
.
Here is an answer about doing so in Apache web server. Using PHP
You can see this answer about checking the host domain name and then you can redirect if the domain is example1.com