Apache 웹서버에서 HTTP로 접속(http://example.com)했을 때 HTTPS(https://example.com)으로 접속하도록 리다이렉션(Redirection)하는 방법이다. 웹서버 설정 파일(.conf) 파일이 아닌 디렉터리 루트의 .htaccess 파일을 통해 설정할 것이다.
.htaccess 파일을 호스팅 디렉터리 루트에 생성하고 아래와 같이 작성한다.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Info.plist 파일에 항목을 추가하고 Key 입력 필드에 “NSCameraUsageDescription” 입력 후 Value 입력 필드에 카메라 권한이 왜 필요한지 어디에 사용되는지 등 권한에 대한 설명을 작성한다.
없으면 카메라 기능에 액세스할 때 아래와 같은 오류가 발생하고 앱은 비정상 종료된다.
2021-12-06 10:38:43.405974+0900 example[25586:8408389] [access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.