We help IT Professionals succeed at work.

Ubuntu Server, Apache2, SSL -- How do I turn off http access to my webserver? I want HTTPS only

oxygen_728
oxygen_728 asked
on
813 Views
Last Modified: 2013-12-16
Hi.

I just got SSL working on my ubuntu server - apache2  web server .

I either want to disable normal http access to my site or automatically or automatically redirect all http traffic to the https version.

Any tips?

Thanks

Open in new window

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2007
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Top Expert 2008

Commented:
iptables -t NAT POSTROUTING -d ip.of.server -p tcp --dport 80 --REDIRECT --to 443

I wrote the rule out of my head it might need some fine tuning though...it redirects all traffic coming to port 80 to port 443 ..i.e. https.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.