Post Reply 
Redirect http to https of the same domain.
Mar. 21, 2019, 03:35 AM
Post: #5
RE: Redirect http to https of the same domain.
(Mar. 19, 2019 08:42 PM)vlad_s Wrote:  Not quite clear how to do this?

Me too. You have been warned. Wink

After installing Privoxy 3.0.28, I added

Code:
{ +redirect{s@^http://prxbx.com@https://prxbx.com@} }
NO-REQUEST-TAG:.*?Tagged

to the end of user.action.

I think it works? There is no loop and Privoxy's log showed:

Quote:2019-03-20 20:59:10.546 00002cd8 Header: scan: GET http://prxbx.com/download/ HTTP/1.1
2019-03-20 20:59:10.546 00002cd8 Header: scan: Host: prxbx.com
2019-03-20 20:59:10.546 00002cd8 Header: scan: User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
2019-03-20 20:59:10.546 00002cd8 Header: scan: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
2019-03-20 20:59:10.546 00002cd8 Header: scan: Accept-Language: en-US,en;q=0.5
2019-03-20 20:59:10.546 00002cd8 Header: scan: Accept-Encoding: gzip, deflate
2019-03-20 20:59:10.562 00002cd8 Header: scan: DNT: 1
2019-03-20 20:59:10.562 00002cd8 Header: scan: Connection: keep-alive
2019-03-20 20:59:10.562 00002cd8 Header: scan: Upgrade-Insecure-Requests: 1
2019-03-20 20:59:10.578 00002cd8 Header: Updated action bits based on: NO-REQUEST-TAG:.*?Tagged
2019-03-20 20:59:10.578 00002cd8 Header: Keeping the client header 'Connection: keep-alive' around. The server connection will be kept alive if possible.
2019-03-20 20:59:10.578 00002cd8 Header: New HTTP Request-Line: GET /download/ HTTP/1.1
2019-03-20 20:59:10.578 00002cd8 Redirect: pcrs command "s@^http://prxbx.com@https://prxbx.com@" changed "http://prxbx.com/download/" to "https://prxbx.com/download/" (1 hit).
2019-03-20 20:59:10.593 00002cd8 Redirect: New URL is: https://prxbx.com/download/

2019-03-20 20:59:11.656 00001f70 Header: scan: GET http://prxbx.com/download/ HTTP/1.1
2019-03-20 20:59:11.656 00001f70 Header: scan: Tagged: ProxHTTPSProxyMII FrontProxy/v1.5 Python/3.4.4:609
2019-03-20 20:59:11.672 00001f70 Header: Tagger 'tagger4https' added tag 'Tagged: ProxHTTPSProxyMII FrontProxy/v1.5 Python/3.4.4:609'. Action bits updated accordingly.


Code:
{ +redirect{s@^http://@https://@} }
NO-REQUEST-TAG:.*?Tagged

also works for me but will redirect sites that don't support https.

Quote:2019-03-20 22:15:04.198 00002118 Header: scan: GET http://prxbx.com/download/ HTTP/1.1
2019-03-20 22:15:04.198 00002118 Header: scan: Host: prxbx.com
2019-03-20 22:15:04.198 00002118 Header: scan: User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
2019-03-20 22:15:04.198 00002118 Header: scan: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
2019-03-20 22:15:04.214 00002118 Header: scan: Accept-Language: en-US,en;q=0.5
2019-03-20 22:15:04.214 00002118 Header: scan: Accept-Encoding: gzip, deflate
2019-03-20 22:15:04.214 00002118 Header: scan: DNT: 1
2019-03-20 22:15:04.214 00002118 Header: scan: Connection: keep-alive
2019-03-20 22:15:04.214 00002118 Header: scan: Upgrade-Insecure-Requests: 1
2019-03-20 22:15:04.214 00002118 Header: Updated action bits based on: NO-REQUEST-TAG:Tagged
2019-03-20 22:15:04.230 00002118 Header: Keeping the client header 'Connection: keep-alive' around. The server connection will be kept alive if possible.
2019-03-20 22:15:04.230 00002118 Header: New HTTP Request-Line: GET /download/ HTTP/1.1
2019-03-20 22:15:04.230 00002118 Redirect: pcrs command "s@^http://@https://@" changed "http://prxbx.com/download/" to "https://prxbx.com/download/" (1 hit).
2019-03-20 22:15:04.230 00002118 Redirect: New URL is: https://prxbx.com/download/

2019-03-20 22:15:05.292 000025c0 Header: scan: GET http://prxbx.com/download/ HTTP/1.1
2019-03-20 22:15:05.292 000025c0 Header: scan: Tagged: ProxHTTPSProxyMII FrontProxy/v1.5 Python/3.4.4:650
2019-03-20 22:15:05.308 000025c0 Header: Tagger 'tagger4https' added tag 'Tagged: ProxHTTPSProxyMII FrontProxy/v1.5 Python/3.4.4:650'. Action bits updated accordingly.

HTH
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Redirect http to https of the same domain. - JJoe - Mar. 21, 2019 03:35 AM

Forum Jump: