Prevent HTTP access to my HTTPS site


#1

Hi guys,

Real newbie here. Sorry if this is a silly question, but I could really use the help. I have setup my secure website with dream host, so now my page is accessible using either HTTP or HTTPS. I would like to either prevent people from using HTTP, or redirect them to HTTPS if they do use it. I am pretty sure this is possible, I just don’t know how. Any help is appreciated!

Regards,
Rob.


#2

I am not an expert on this. But your redirect leads me to this page. Maybe this can help.
http://wiki.dreamhost.com/Redirect_Domain

$50 off and 3 free domains with code: [color=#CC0000]DH3[/color] Sign Up NOW or More Codes Here


#3

Well, if you just want them to use the https version of any page they connect to, you can use the following in your htaccess to rewrite the url to the https version:

RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}There are other versions if you just want to redirect them to a specific page on your site.

extra domains and the new maximum $50 off with codes [color=#CC0000]1DOM50, 2DOM50 and 3DOM50[/color]. More Dreamhost coupons


#4

I thought about the redirect using the DH web panel, but this does not take in to account HTTP versus HTTPS, only the domain itself and for me these are the same domain. I will try the htaccess file suggested by ‘Lensman’.

Thank you both for the reply and the support.

Rob.


#5

This works like a champ!! Thanks a lot, I really appreciate the help.

Happy Holidays!!

Rob.


#6

Anytime! Glad it worked out for you.

Remember that you can redirect/rewrite to other pages on your site if someone bookmarks or links to an http page on your site - to the https login page, for instance.

Have fun and have a happy holidays yourself!
-lens

extra domains and the new maximum $50 off with codes [color=#CC0000]1DOM50, 2DOM50 and 3DOM50[/color]. More Dreamhost coupons