0

I have an application which I'm using to practice with, which will re-direct traffic from a certain website to a different website.

For example

1.

User opens a web-browser and types in a link like "www.youtube.com".

2.

The user presses 'enter' and they're forwarded to www.youtube.com.

Now, what if I don't want to go to this website, and I want to redirect the search to a different domain? How would I do this? Would it look something like this?

Dim website As "www.youtube.com"
If website.IsSearched = True Then
MesssageBox.Show("This site is whitelisted.")

I know this code will NOT work, but, it's a brief example of what I'm trying to achieve.

Any help or references to projects would be great.

1
  • As far as I know you have two options: 1) Create a plugin for every web browser you wish to apply it to (assuming you can interact with them in such a way), or 2) Create a firewall. || The latter is of course the most advanced as it requires knowing C/C++ and the WFP API (Windows Filtering Platform). The former depends on what technology the target browser requires you to use. In general what you ask for is not something that is easily achieved. You need to do a lot of research around the subject. Jun 19, 2018 at 10:57

2 Answers 2

0

want to redirect the search to a different domain

You could use the hosts file, which can override dns and make browsers believe youtube.com's IP address is whatever you like. You could maybe redirect it to 127.0.0.1 where you handle the incoming request yourself, like a proxy, and give the edited response back. Https obviously won't work, since you are not really youtube.com, but http will.

tldr; this is not a .net question

0

Do it in webbrowser navigating event. When user presses enter, navigating will fire, then you can check the url and do whatever.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.