Hi, this is my situation:
I need to create an app that listens to URL's entered on a browser so that when a particular site is entered (e.g. google.com), it redirects this to www.mysite.com/Redirect.aspx?site=google.com, so that this click is recorded on mysite.com and then the user is redirected to the original entry i.e. google.com
One idea I had was to create an app on Windows that edits the Hosts file. So what I did was, added an entry for google.com, redirecting it 1.2.3.4 (IP of my server), so that the click can be recorded there and the user can be redirected back to google.com
However the problem with this is that, since Hosts redirects any request for google.com to 1.2.3.4, this whole redirect sequence would be going round in a loop since 1.2.3.4 would lead it to google.com as well.
Could anyone please suggest what I could do to get around this or a better solution?
What I want is similar to parental control software i.e. when a certain website is visited, e.g. www.porn.com, it recognises this address and leads the user to a different site.
The sequence of actions would be :
User enters google.com -> Redirect to mysite.com?Redirect.aspx?site=google.com (record entry on my server) -> go to google.com
Please help!