coreserverã®å ±ç¨SSLã¯Wordpressã®is_ssl()ã§å¤å¥ã§ããªã
Wordpressãã©ã°ã¤ã³ã«ã¤ãã¦èª¿ã¹ã¦ãã¦ããã¾ãã¾ãã®ç¾è±¡ã«è¡ãå½ããã¾ãããç¥ãããã£ãäºã§ã¯ãªãã£ããã©ãããã¯ããã§ã¡ã¢ãã¦ããããã
<?php /** * Determine if SSL is used. * * @since 2.6.0 * * @return bool True if SSL, false if not used. */ function is_ssl() { if ( isset($_SERVER['HTTPS']) ) { if ( 'on' == strtolower($_SERVER['HTTPS']) ) return true; if ( '1' == $_SERVER['HTTPS'] ) return true; } elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) { return true; } return false; }http://svn.automattic.com/wordpress/tags/3.3.1/wp-includes/functions.php
Wordpressã§ã¯ããã®is_ssl()
é¢æ°ã§httpsãªã¢ã¯ã»ã¹ãã©ãããå¤å¥ãã¦ã¾ããcoreserverã®å
±ç¨SSLã§ã¯ããã®å¤å¥ã«ä½¿ã$_SERVER['HTTPS']
ãããã¨ãSSLã§ãåå¨ããªãã¨ããè¬ã®ä»æ§ã«ãªã£ã¦ããããã§ããããã$_SERVER['SERVER_PORT']
ã¯ã¨ããã¨ããããã©ãããããã80ã«ãªã£ã¦ãã¾ãã
ããã§å°ãäºã¨ãã¦ãã¨ãããããã©ã°ã¤ã³ããã¼ããèªã¿è¾¼ãJavaScriptãcssã®ãã¹ããhttpã«ãªã£ã¦ãã¾ããhttpsãªãã¼ã¸ããhttpãªãªã½ã¼ã¹ãèªã¿è¾¼ãã§ããã¨ããè¦åãåºã¦ãã¾ãã¨ããäºãããã¾ãããã¡ããããã ããããªããä»ã«ãããã¨æãã¾ããã
ãã¨ãå¤åä»ã®ãã¬ã¼ã ã¯ã¼ã¯ã¨ãCMSã¨ããã$_SERVER['HTTPS']
ãè¦ã¦ããã®ã¯ããã¤ãããã¨æãã®ã§ãcoreserverã®å
±ç¨SSLããã®ã¾ã¾ä½¿ããã¨ããã¨ããããããããªãã
解決çã¯ä¸æ
ä»åã¯ããã¾ãã¾æ°ã«ãªã£ã¦èª¿ã¹ãã ãã§ãcoreserverã®å
±ç¨SSLãWordpressã§ä½¿ãããã£ã¦ãããããªãã®ã§ã解決çã¯èª¿ã¹ã¦ã¾ãããis_ssl()
ã«ããã¯ãç¡ãã®ã§ãç°¡åã«ã¯è§£æ±ºåºæ¥ãªããããªæ°ããã¾ããã
å¤å¥ã«ä½¿ããããªãã¼
["HTTP_VIA"]=> string(44) "1.1 ss1.coressl.jp:3128 (squid/2.5.STABLE14)"
ãã£ã¨var_dump($_SERVER)
ãçºããã¨ã$_SERVER['HTTP_VIA']
ãå¤å¥ã«ä½¿ãããã§ããèªåã®ããã°ã©ã ã ã£ãããããã使ã£ã¦ã©ãã¨ã§ãæ¸ãããã ãã©ãWordpressã«çµã¿è¾¼ã¾ããé¢æ°ã¨ãªãã¨ããã¯ãWordpressæ¬ä½ã«æãå
¥ããªãã¨é£ãããã
ãã®ä»ã®æ°ã«ãªãç¹
coreserverã¯ç¢ºããç¬èªSSLããªãã·ã§ã³ã§ä½¿ããã¨æãã¾ãããããå ±ç¨SSLã¨åããããªåãããããããããcoreserverã§ä½ããããªã確èªãã¦ããããã¨ããã