Redirect from a domain name to a square box with a square box

I have a php server running my domain name. For testing purposes, I run asp.net on a dotted quad IP address. I hope to link them together via PHP or some kind of DNS / .htaccess voodoo.

So, if I go to www.mydomain.com/test , it redirects (but stores the URL ( www.mydomain.com/test ) in the address bar of the browser, and the pages are served by a square asp.net box with four squares.

+4
source share
5 answers

Instead of specifying www.yourdomain.com/test on a test server, why not use test.yourdomain.com ?

Assuming you have access to the DNS records for yourdomain.com , you just need to create a mapping of the A test.yourdomain.com to your test server IP address.

+6
source

This is entirely possible if I understand what you are getting.

You have a PHP server with your domain pointing to it. You also have a separate ASP.NET server that only has an IP address associated with it, not a single domain.

Is there a drawback to simply specifying your domain name in an ASP.NEt field?

0
source

The easiest way is to get www.mydomain.com/test serve an HTML file that has one frame with a simple IP address. However, this means that the URL in the (awesome) address bar always remains unchanged, even if you click on the link on the displayed page. (You can avoid this by adding target=_top in href , but this will require some changes for your "asp.net".)

The only other way I can think of is to make www.mydomain.com act like a proxy. That is, in /test it has a script or something that receives a page from your "asp.net" and redirects it to the client.

0
source

You can do this using a proxy server, but I think Will Harris's answer would be better - use a subdomain. Much easier, and it will also get rid of problems with relative links.

0
source

I agree that the idea of ​​a subdomain is the best, but if for some reason it does not work for you, you can also have a php page in / proxy server for the url in the dotted quad machine (using fopen for access to the dotted square URL).

0
source

Source: https://habr.com/ru/post/1276557/


All Articles