lundi 24 avril 2017

How To Redirect A Domain To An IP Address With A Directory In Your Hosts File?

I'm having trouble figuring out how to redirect a domain.

Basically here's what I'm doing.

I have a Mac and I want to test a software application that will eventually go live on our company website. So I want to test some of its features first. Some features include, pinging a domain (companysite.com) for some files to see if there are any updates.

So what I want to do is, redirect any pings to companysite.com to my company's test web server by modifying my local hosts file on my Mac.

So whenever I run the application locally on my Mac, it will try to ping companysite.com, it will be redirected to my company's test web server IP address (92.xx.xxx.xx).

The problem now becomes, once it gets redirected, I need to handle that on the test web server, to point the request to a specific directory. This is the part that I don't know how to handle. How do I intercept this on the webserver, so that it will then point it to a specific directory within the web server?

Another question is, is there a simpler way of doing this? Am I just making it too complicated?




Aucun commentaire:

Enregistrer un commentaire