You are not logged in.

#1 2022-06-03 16:30:07

QuickQuokka
Member
Registered: 2022-05-26
Posts: 18

Redirect from website to other website using /etc/hosts?

Hi there!

I recently tried adding

twitter.com nitter.net
www.twitter.com nitter.net

to my /etc/hosts file, but it doesn't work.


I then tried

104.244.42.193 nitter.net

as 104.244.42.193 is the IP address of Twitter according to nslookup. That also didn't work.

Any ideas?

Offline

#2 2022-06-03 16:41:05

progandy
Member
Registered: 2012-05-17
Posts: 5,319

Re: Redirect from website to other website using /etc/hosts?

If you want to redirect from twitter to nitter, you'd have to use the ip from nitter and the twitter domain. You will get TLS/SSL errors since nitter has no valid certificate for the twitter domain.

185.246.188.57 twitter.com

A simpler option would be a redirect inside the browser like https://addons.mozilla.org/firefox/addo … y-redirect


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2022-06-03 16:54:08

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,596

Re: Redirect from website to other website using /etc/hosts?

progandy wrote:

A simpler option would be a redirect inside the browser like https://addons.mozilla.org/firefox/addo … y-redirect

Excellent idea;), however, may as well choose one that is actively maintained see the chat in this issue: https://github.com/SimonBrazell/privacy … issues/378

github+addons
https://github.com/libredirect/libredirect
https://addons.mozilla.org/en-US/firefo … ent=search

Offline

#4 2022-06-03 17:12:54

mpan
Member
Registered: 2012-08-01
Posts: 1,613
Website

Re: Redirect from website to other website using /etc/hosts?

Even ignoring certificate mismatch, there would be mismatch regarding the `Host` header. Depending on how the target is configured and how it uses the header, it may not be able to handle the connection at all or — though this isn’t expected to be the case with Nitter — may include resources from a wrong address.

Unless you have 3rd party requests to Twitter blocked in your browser, it would also lead to Nitter being bugged each time some webapp running Twitter code is accessed. That is both causing additional load to the service and may break the webapp in a manner more complicated than a blocked request.

That makes such a simple substitution a bad idea and limits you to in-browser solutions.

Offline

Board footer

Powered by FluxBB