Apache HTTP to HTTPS 리다이렉션(.htaccess)

Apache 웹서버에서 HTTP로 접속(http://example.com)했을 때 HTTPS(https://example.com)으로 접속하도록 리다이렉션(Redirection)하는 방법이다. 웹서버 설정 파일(.conf) 파일이 아닌 디렉터리 루트의 .htaccess 파일을 통해 설정할 것이다. .htaccess 파일을 호스팅 디렉터리 루트에 생성하고 아래와 같이 작성한다.