You may find yourself in a situation where you will need to redirect all URLs from a domain (lets say www.example.com) to another one (lets say www.example.org). This can be done with squid, a proxy server, and squidGuard, an extension to squid designed to do redirections. In this article I will deal only with redirections of HTTP requests made to that domain.
First install squid and squidGuard on your machine (you should be able to find packages for them in the repository of your distribution).
You can now enable and start the proxy: systemctl enable squid and systemctl start squid.
You now need to configure your software to use it. For instance, if you use NetworkManager, to make all requests go through it:
- Open the network settings.
- Go under Network proxy.
- Select Manual in Method.
- Fill the first field of HTTP Proxy with localhost and put 3128 in the second one.
That's it. If you have a problem or a question, please leave a comment.