#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2016
    Location
    Lakewood, WA
    Posts
    239
    Rep Power
    65

    Redirects and SSH Certs


    Disclaimer: I have looked at the mod-rewrite sticky.

    What is the PREFERED method to directing www.MyDomain.com and MyDomain.com to the same directory?

    Should this be combined with forced HTTPS?

    Not that I have anything that man-in-middle or some such hack would be tasty to lurking data hackers, but it seems "best practice" that if one has a SSH cert, force the use of it?

    if I can put it all in my httpd.conf, that seems the way to go, I don't really want to have to look all over Hell and gone for .htaccess files I might or might not have written and forgot about, in the past that has lead me to have weird Apache problems hidden in .htaccess files I'd forgot about.
  2. #2
  3. Headless Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,972
    Rep Power
    9647
    Make the virtualhost support both the www and non-www versions (via a ServerName and ServerAlias), then use mod_rewrite to redirect one to the other. Anything you can put in a .htaccess you can put (with a slight performance gain) in httpd.conf too.

    Forced HTTPS is a separate but overlapping issue. You should do it.

    By "SSH cert" I assume you mean SSL cert? Yes, if you have it then you should use it. That's the point of having it in the first place.

IMN logo majestic logo threadwatch logo seochat tools logo