From: Fabian K. <fk...@fa...> - 2011-03-27 15:52:49
|
johhny_at_poland77 <joh...@zo...> wrote: > I have a few Privoxy rules, that can redirect HTTP Wikipedia [en,de] traffic to HTTPS: > (a little part from the "user.action" file:) > > > { +redirect{s@http://en.wikipedia.org/wiki/@https://secure.wikimedia.org/wikipedia/en/wiki/@} } > .en.wikipedia.org > > > { +redirect{s@http://de.wikipedia.org/wiki/@https://secure.wikimedia.org/wikipedia/de/wiki/@} } > .de.wikipedia.org > > > ..so you get the problem: is there any way to put a "regexp" or something to: "en", "de"? Yes. The +redirect{} action takes a pcrs command as parameter, so it supports the same PCRE features filters do. If the pattern doesn't match, no redirect will be generated, so you could change the URL pattern to ".wikipedia.org" and let the pcrs command decide whether or not to redirect the request. > There are hundreds of other languages, i think it's a bad solution to write down them all. Do you read and understand Wikipedia articles in hundreds of other languages? If not, why do you care? > There is another question: is my solution good so far? It would be more correct to escape the dots in the patterns of the pcrs commands, as you are looking for literal dots, but not doing that is unlikely to cause problems in this case. > I'm asking that because if i visit: > > > https://secure.wikimedia.org/wikipedia/en/wiki/File:Nokota_Horses_cropped.jpg > that's ok, it's using HTTPS. BUT if i click on the picture: > > > http://upload.wikimedia.org/wikipedia/commons/d/de/Nokota_Horses_cropped.jpg > it's using _HTTP_ !!! - so this is not good. Are the pictures on a HTTP-only server, > or i can write another redirect rule to view the pictures in HTTPS? I don't know. The "HTTPS Everywhere" Firefox plugin has already been mentioned and I assume its creators do know. If you can't or don't want to use the plugin itself, you can probably still safe a lot of time by having a look at its configuration file. Fabian |