Redirect port 80 to 443 (Using HTTPS Under Wub)

17 views
Skip to first unread message

ATK

unread,
Jun 30, 2015, 7:48:24 AM6/30/15
to wub-dis...@googlegroups.com

Hi,
I am looking to redirect incoming port 80 requests to port 443.

I have set up https with my certificate and public key files configured in site.config

This works perfectly well if you access https://www.koroma.co.za for example.

What I will like to achieve is, when a user types the url (e.g http://www.koroma.co.za) , I want him/her to be automatically redirected to port 443 (https://www.koroma.co.za).

I have tried router port forwarding and iptables port forwarding, but they both failed to achieve what I'm looking for.

Your input will be appreciated.

Thanks

ATK

unread,
Aug 24, 2015, 6:51:58 PM8/24/15
to Wub Discussion

I used a nub rewrite to rewrite the http url to https.

Inserted the nub in the site.config file as follows;

httptohttpsrewrite {
    url {^http://www.koroma.co.za}
    rewrite {https://koroma.co.za}
}

It works just as I wanted it to and I'm pretty sure it will also work without the (^) sign. Nub is a great utility, will definitely play around with it some more.
Reply all
Reply to author
Forward
0 new messages