Needlworks / Textcube

Textcube : Brand yourself! / Personalized web publishing platform with multi-user support
http://www.textcube.org
Other
207 stars 55 forks source link

ssl을 사용하면서 두개의 문제가 있습니다. #1843

Closed kekeke00 closed 8 years ago

kekeke00 commented 8 years ago
  1. 로그인을 하면 빈페이지가 뜹니다. (정확히는 호스팅사 404에러 페이지가 뜨는데 https주소라 빈페이지로 뜨는듯합니다. 호스팅사 404에러 페이지 타이틀이 탭에 적혀있습니다) 다시 owner 주소로 들어가면 정상적으로 로그인 되어있어 관리자화면이 그제서야 보입니다. (ssl을 사용하지 않은 타 호스팅계정에 테스트를 해보니 빈페이지 없이 잘작동합니다)
  2. 모든 플러그인 환경설정에서 저장이 안됩니다. 이건 .htaccess로 항시적용해두던 https를 풀고 필요할때마다 설정해 썼습니다. (크롬 개발자도구로 보니 EAF4.js를 가리키는데 그이상은 초보라 어떻게 할줄도 모릅니다)

이곳에 적는게 맞는지 잘 모르겠습니다. 맞다면 앞으로 문제있을때 이리 보고하겠습니다.

inureyes commented 8 years ago

@kekeke00 확인해 보겠습니다. 말씀 주신 것만으로 판단해 보면 config.php$serviceURL 옵션을 주지 않아서 그런게 아닌가 싶습니다. 서버에서 강제로 https로 리다이렉션 설정을 하지 않은 경우엔 $serviceURL 로 https 경로를 설정해 주어야 하거든요.

$serviceURL = 'https://example.com';

처럼 추가하면 됩니다.

kekeke00 commented 8 years ago

확인하니 serviceURL에 경로가 설정되어 있습니다.

.htaccess에

RewriteCond %{HTTPHOST} ^www.(.+)$ [NC] RewriteRule ^(.)$ http://%1/$1 [L,R=301] RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"' RewriteRule ^(._)$ https://주소/$1 [L,R=301]

와 같이 적용해서 쓰는데 이게 잘못된건지 확인차 올립니다.

이전글에 썻다시피 플러그인 설정을 저장할때 이 문구를 삭제하고 http로 접속해서 수정을 해서 쓰고 있습니다.

inureyes commented 8 years ago

원래는 .htaccess 수정이 필요가 없습니다. (보통 아파치나 엔진엑스 서버사이드에서 http -> https 바이패스를 걸어서요. .htaccess에서 처리한다고 하면

RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

정도 해 주면 될 것 같습니다.

덧) https로 돌아가는 제 서버의 경우

#<IfModule mod_url.c>
#CheckURL Off
#</IfModule>
#SetEnv PRELOAD_CONFIG 1
#<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(thumbnail)/([0-9]+/.+)$ cache/$1/$2
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(cache)+/+(.+[^/]).(cache|xml|txt|log)$ - [NC,F,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ $1/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ rewrite.php [L,QSA]
#</IfModule>
inureyes commented 8 years ago

@kekeke00 좀 간단하게 설정할 방법을 준비하겠습니다 💃