I currently have a Linux Dedicated Server and I would like to 301 Redirect several versions of my domain name (and its files/directories) to the https:// version via .htaccess. My goal is to have ONE version of my domain no matter how it is typed and no matter what file and/or subdirectory is trying to be reached.
What I am seeking...
- http:// example.com >> https:// example.com
- http:// www.example.com >> https:// example.com
- https:// www.example.com >> https:// example.com
Examples of files/directories...
- http:// example.com/1.jpg >> https:// example.com/1.jpg
- http:// www.example.com/sub/ >> https:// example.com/sub/
- https:// www.example.com/sub/1.jpg >> https:// example.com/sub/1.jpg
Notice how everything 301's to https://example.com ?
**Lets pretend I have a completely blank .htaccess file and would like to accomplish this set-up. How should my code look like? I really do not have a .htaccess file and 0 add-ons or customization to my server.