WEB/etc.

[openSSL] cafe24에서 openSSL 설치 후 redirect

_yoonie 2022. 8. 10. 21:33

http에서 https로 바뀌면서 소스 또한 바꿔줘야 할 부분이 많다.

1. daum 주소 API 의 script 주소 변경

2. 이니시스 결제창의 closeUrl, returnUrl

 


1. Redirect

소스 말고도 네이버에 우리 사이트가 올라가있다면

http://www.@@@.co.kr 

이런 식으로 등록되어있을 것이다.

 

이걸 하나하나 다 바꾸려고 하지말고 redirect를 해야한다.

 

cafe24에서 호스팅하고있다면 방법은 아주 쉽다.

FTP에 접속해 .htaccess파일을 열고

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteCond %{ENV:HTTPS} !=on
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

이걸 맨 위에 넣어준다.

그럼 끝이다!

 

2. 특정 URL만 예외처리 하는 설정

# URL 주소 안에 test 디렉토리가 포함되면 redirect를 하지 않을 때

    RewriteCond %{REQUEST_URI} !^/test/.*$      #### Redirect예외 URL
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

# URL 주소 안에 test 특정 파일이 포함되면 redirect를 하지 않을 때

	RewriteCond %{REQUEST_URI} !^/index.html
    RewriteCond %{REQUEST_URI} !^/(file1|file2|file3|.....) -- 여러 파일

 


추가적으로 보안설정이 필요한 부분은 파일 참고

 

728x90