반응형
Apache에서 vue 기록이 있는 https 강제 적용
vue.js 기록의 apache에서 .htaccess를 통해 https 연결을 강제 적용:
Vue 기록에는 다음과 같은 .htaccess가 필요하다.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
SSL 연결을 강제 적용하도록 이 .htaccess를 수정하려면 어떻게 해야 하는가?
3호선과 4호선은 https로 리디렉션하기 위한 것이다.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
이것은 오래된 질문이지만, 내가 vue에서 ssl을 강제하기 위해 사용하고 있는 것은 이것이다.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
참조URL: https://stackoverflow.com/questions/48058494/force-https-with-vue-history-in-apache
반응형
'programing' 카테고리의 다른 글
순기능의 이점 (0) | 2022.05.04 |
---|---|
Java Map이 컬렉션을 확장하지 않는 이유 (0) | 2022.05.04 |
vuexfire로 쿼리하는 방법 (0) | 2022.05.04 |
내 jar File에서 리소스 폴더의 폴더에 액세스하는 방법 (0) | 2022.05.04 |
vuejs에서 기본 페이지 지정을 편집하시겠습니까? (0) | 2022.05.04 |