Question

I have a php server that is running my domain name. For testing purposes I am running an asp.net on a dotted quad IP. I am hoping to link them together via either PHP or some kind of DNS/.htaccess voodoo.

So if I go to www.mydomain.com/test it redirects (but keeps the url of (www.mydomain.com/test) in the browser's address bar and the pages are served by the dotted quad IP asp.net box.

Was it helpful?

Solution

Instead of pointing www.yourdomain.com/test at your test server, why not use test.yourdomain.com?

Assuming you have access to the DNS records for yourdomain.com, you should just need to create an A record mapping test.yourdomain.com to your test server's IP address.

OTHER TIPS

It is quite possible, if I understand what you're getting at.

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, no domain.

Is there any drawback to simply pointing your domain name to your ASP.NEt box?

The easiest way is to make www.mydomain.com/test serve a HTML file which has a single frame with the plain IP address. However, this means that the URL in the (awesome) address bar always stays exactly the same, even if you click a link on the displayed page. (You can avoid this by adding target=_top in the href, but this would require some modifications to your "asp.net".)

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

You can do this with a proxy, but I think Will Harris's answer is the best - use a subdomain. Much simpler, and it'll get rid of issues with relative links as well.

I agree that the sub-domain idea is the best, but if for some reason it doesn't work for you you could also have the php page at /test proxy requests to a URL at the dotted quad machine (using fopen to access the dotted quad URL).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top