Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CorporateFelon

macrumors regular
Original poster
Oct 26, 2007
177
0
Boston, MA
I haven't found anything in Server Admin yet, and have yet to read up on the documentation, but I cant seem to find a simple way to set up a site to automatically forward a user to https if they try to connect via http.

My work around is to have a duplicate site set up on port 80 pointing at a directory only containing an .htaccess file that automatically redirects all requests to the https version. This simple solution works quite well, but I'd prefer a more controllable method.

Any one know if what I am trying to accomplish is easily done in the Server Admin?
 

bartzilla

macrumors 6502a
Aug 11, 2008
540
0
I haven't found anything in Server Admin yet, and have yet to read up on the documentation, but I cant seem to find a simple way to set up a site to automatically forward a user to https if they try to connect via http.

My work around is to have a duplicate site set up on port 80 pointing at a directory only containing an .htaccess file that automatically redirects all requests to the https version. This simple solution works quite well, but I'd prefer a more controllable method.

Any one know if what I am trying to accomplish is easily done in the Server Admin?

A simple way if your users are just hitting a landing page (e.g. they're typing 'www.example.com' into their browser and ending up at "http://www.example.com" where you want them to be at "https://www.example.com/very/secure" is to just have a default document that contains a simple meta redirect. Simple, dirty, not at all "robust" but sometimes its good enough, you know?
 

CANEHDN

macrumors 6502a
Dec 12, 2005
855
0
Eagle Mountain, UT
A simple way if your users are just hitting a landing page (e.g. they're typing 'www.example.com' into their browser and ending up at "http://www.example.com" where you want them to be at "https://www.example.com/very/secure" is to just have a default document that contains a simple meta redirect. Simple, dirty, not at all "robust" but sometimes its good enough, you know?

The only downside to this is you would get an infinite loop if you're trying to redirect to the same page. http://www.mydomain.com/home/ to https://www.mydomain.com/home/ the page would continually redirect if using simple html. You'd need a scripting language PHP or something to check the domain to see if it needs to redirect.
 

ruud

macrumors regular
Jul 1, 2004
103
0
You can do this entirely from within Server Admin.

Set up 2 sites, one on port 80, and one on port 443 with SSL enabled.

On the site on port 80, go to the Aliases tab and in the second pane, add a redirect as follows:
type: redirect
pattern: /
path: https://www.yourdomain.com/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.