最新版 |
編集中の文章 |
行84: |
行84: |
| | | |
| === 管理側SSLを有効化するとリダイレクトループが起きる === | | === 管理側SSLを有効化するとリダイレクトループが起きる === |
− |
| |
− | さくらサーバの場合(2017/04/7時点)は、httpsへwwwアリでアクセスしてもHTTP_HOST変数にはwwwなしのドメイン情報がセットされる仕様に変わっているようです。
| |
− |
| |
− | https://www.example.com/ の場合、 HTTP_HOST example.com となる。
| |
− |
| |
− | 通常だったら HTTP_HOST www.example.com になるはず。
| |
− |
| |
− | そこで、対応方法としては
| |
| | | |
| - htaccess で調整する。 | | - htaccess で調整する。 |
行110: |
行102: |
| RewriteCond %{REQUEST_FILENAME} !-f | | RewriteCond %{REQUEST_FILENAME} !-f |
| RewriteRule ^(.*)$ index.php [QSA,L] | | RewriteRule ^(.*)$ index.php [QSA,L] |
− | </pre>
| |
− |
| |
− |
| |
− | SNI利用の場合は下記でうまくいきました。
| |
− | <pre>
| |
− | RewriteCond %{ENV:HTTPS} !^on$
| |
− | RewriteCond %{HTTP:X-SAKURA-FORWARDED-FOR} ^$
| |
− | RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
| |
− | </pre>
| |
− |
| |
− |
| |
− | * baserCMS3系の場合
| |
− |
| |
− | 上記の対応のみでOK
| |
− |
| |
− | * baserCMS4系の場合
| |
− |
| |
− | コアの処理で管理画面の場合にadminSslの値と関係なく
| |
− | リダイレクトしようとしている箇所があるので、その部分をコメントアウトする。
| |
− |
| |
− | lib/Baser/Controller/BcAppController.php 260行あたり
| |
− |
| |
− |
| |
− | <pre>
| |
− |
| |
− | public function beforeFilter() {
| |
− | parent::beforeFilter();
| |
− |
| |
− | $isRequestView = $this->request->is('requestview');
| |
− | $isUpdate = $this->request->is('update');
| |
− | $isAdmin = $this->request->is('admin');
| |
− | $isInstall = $this->request->is('install');
| |
− | $isMaintenance = $this->request->is('maintenance');
| |
− |
| |
− | // CUSTOMIZE DELETE 2017/04/07
| |
− | // ※ さくらサーバの場合の不具合のため、管理画面リダイレクト処理を削除(.htaccessにて対応)
| |
− | // さくらの共有サーバーでSNIを使ってSSLを導入の場合、
| |
− | // https://www.example.com/ でアクセスしてもHTTP_HOST = example.com となり、siteUrl()の値が正しくない。
| |
− | // 通常のサーバではHTTP_HOST = www.example.com がセットされている。
| |
− | // >>>
| |
− | // // 設定されたサイトURLとリクエストされたサイトURLが違う場合は設定されたサイトにリダイレクト
| |
− | // if($isAdmin) {
| |
− | // if($this->request->is('ssl')) {
| |
− | // $siteUrl = Configure::read('BcEnv.sslUrl');
| |
− | // } else {
| |
− | // $siteUrl = Configure::read('BcEnv.siteUrl');
| |
− | // }
| |
− | // if($siteUrl && siteUrl() != $siteUrl) {
| |
− | // $this->redirect($siteUrl . preg_replace('/^\//', '', Router::reverse($this->request, false)));
| |
− | // }
| |
− | // }
| |
− | // <<<
| |
− |
| |
− | // メンテナンス
| |
− | if (!empty($this->siteConfigs['maintenance']) && (Configure::read('debug') < 1) && !$isMaintenance && !$isAdmin && !BcUtil::isAdminUser()) {
| |
− | if (!empty($this->request->params['return']) && !empty($this->request->params['requested'])) {
| |
− | return;
| |
− | } else {
| |
− | $redirectUrl = '/maintenance';
| |
− | if ($this->request->params['Site']['alias']) {
| |
− | $redirectUrl = '/' . $this->request->params['Site']['alias'] . $redirectUrl;
| |
− | }
| |
− | $this->redirect($redirectUrl);
| |
− | }
| |
− | }
| |
| </pre> | | </pre> |
| | | |
| === メールアドレスでエラー === | | === メールアドレスでエラー === |
− | 指定したメールアドレスが送信できない場合、STEP4でエラーになる。
| + | メールアドレスが設定されていないなどするとSTEP4でエラーになる。 |
| | | |
| さくらレンタルサーバから送信可能なアドレスを指定してインストールしてください。 | | さくらレンタルサーバから送信可能なアドレスを指定してインストールしてください。 |
− |
| |
− |
| |
− | === basic認証が2回表示される ===
| |
− | htaccessファイルに以下を記載して回避できる。
| |
− |
| |
− | <pre>
| |
− | <If "%{HTTP:X-SAKURA-FORWARDED-FOR} != ''">
| |
− | AuthType Basic
| |
− | AuthName "Input your ID and Password."
| |
− | AuthUserFile /your/password/path/.htpasswd
| |
− | require valid-user
| |
− | </If>
| |
− | </pre>
| |
− |
| |
− | - 参考: http://kayakuguri.github.io/blog/2017/10/10/sakura-ssl/
| |
− |
| |
− |
| |
− |
| |
− | === SSLへリダイレクト出来ない場合(2018/02/22時点) ===
| |
− |
| |
− | X-Sakura-Forwarded-For変数で判別できないサーバはで.htaccessファイルに以下を記載することで対応可能です。
| |
− |
| |
− | <pre>
| |
− | Allow from all
| |
− | RewriteEngine on
| |
− | RewriteBase /
| |
− |
| |
− | SetEnvIf REDIRECT_HTTPS (.*) HTTPS=$1
| |
− | RewriteCond %{ENV:HTTPS} !^on$
| |
− | RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
| |
− |
| |
− | RewriteCond %{REQUEST_FILENAME} !-d
| |
− | RewriteCond %{REQUEST_FILENAME} !-f
| |
− | RewriteRule ^(.*)$ index.php [QSA,L]
| |
− | </pre>
| |
− |
| |
− |
| |
− |
| |
− | - 参考: https://help.sakura.ad.jp/hc/ja/articles/115000051662
| |
− | - 参考: https://help.sakura.ad.jp/hc/ja/articles/360000027581-%E3%83%AC%E3%83%B3%E3%82%BF%E3%83%AB%E3%82%B5%E3%83%BC%E3%83%90%E3%81%AE%E4%BB%95%E6%A7%98%E5%A4%89%E6%9B%B4%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6-2018%E5%B9%B43%E6%9C%88-
| |
| | | |
| == CPIサーバ == | | == CPIサーバ == |
行255: |
行142: |
| CPIサーバでRewriteを有効にするには .htaccess に Options +FollowSymLinks を追記する必要がある。 | | CPIサーバでRewriteを有効にするには .htaccess に Options +FollowSymLinks を追記する必要がある。 |
| (Options +FollowSymLinks の記載がないと Internal server error) | | (Options +FollowSymLinks の記載がないと Internal server error) |
− |
| |
− | <pre>
| |
− | Options +FollowSymLinks
| |
− | </pre>
| |
− |
| |
− |
| |
− | 参考: http://acesr.document.secure.ne.jp/other/tips-htaccess/
| |
| | | |
| 参考: http://ameblo.jp/huangke/entry-10429548096.html | | 参考: http://ameblo.jp/huangke/entry-10429548096.html |
行530: |
行410: |
| | | |
| 参考: http://phpexcel.codeplex.com/discussions/238547 | | 参考: http://phpexcel.codeplex.com/discussions/238547 |
− |
| |
− | === メールフォーム設定画面 送信先メールアドレス のラジオボタンが消える ===
| |
− |
| |
− | HTMLのラジオボタン生成時にIDの0が消えてしまって、JSの動作が正しく動いていない。
| |
− | 保存される値には影響がないが見た目がおかしい。
| |
− |
| |
− | 本来は
| |
− |
| |
− | <pre>
| |
− | <input name="data[MailContent][sender_1_]" id="MailContentSender1_" value="" class="firstChild empty" type="hidden">
| |
− | <input name="data[MailContent][sender_1_]" id="MailContentSender10" value="0" class="firstChild lastChild empty" checked="checked" type="radio">
| |
− | <input name="data[MailContent][sender_1_]" id="MailContentSender11" value="1" class="firstChild lastChild empty" type="radio">
| |
− |
| |
− | <input name="data[MailContent][sender_1]" size="40" maxlength="255" value="" id="MailContentSender1" class="lastChild empty" style="display: inline;" type="text">
| |
− | </pre>
| |
− |
| |
− | のようなHTMLが生成されるが、このサーバの場合は
| |
− | <pre>
| |
− | <input name="data[MailContent][sender_1_]" id="MailContentSender1_" value="" class="firstChild empty" type="hidden">
| |
− | <input name="data[MailContent][sender_1_]" id="MailContentSender1" value="0" class="firstChild lastChild empty" checked="checked" type="radio">
| |
− | <input name="data[MailContent][sender_1_]" id="MailContentSender11" value="1" class="firstChild lastChild empty" type="radio">
| |
− |
| |
− | <input name="data[MailContent][sender_1]" size="40" maxlength="255" value="" id="MailContentSender1" class="lastChild empty" style="display: inline;" type="text">
| |
− | </pre>
| |
− |
| |
− | と表示されてしまう(理由は不明)
| |
− |
| |
− | id="MailContentSender10" → id="MailContentSender1" のように0が消えてしまう。
| |
− |
| |
− | その為、テキストエリアのid="MailContentSender1" とかぶってしまうのが原因。
| |
− |
| |
− | ==== 対応方法 ====
| |
− |
| |
− | ・見た目だけなので、放置する
| |
− |
| |
− | ・ソースを書き換え、ID重複がしないように変更する
| |
− |
| |
− | lib/Baser/Plugin/Mail/View/MailContents/admin/form.php を
| |
− | app/webroot/theme/(テーマ名)/MailContents/admin/form.php へコピーする。(フォルダも作成)
| |
− |
| |
− | app/webroot/theme/(テーマ名)/MailContents/admin/form.php を変更する
| |
− |
| |
− | 22行目
| |
− | <pre>
| |
− | $('input[name="data[MailContent][sender_1_]"]').click(mailContentSender1ClickHandler);
| |
− |
| |
− | ↓
| |
− |
| |
− | $('input[name="data[MailContent][sender_1a]"]').click(mailContentSender1ClickHandler);
| |
− | </pre>
| |
− |
| |
− | 27行目
| |
− | <pre>
| |
− | $("#MailContentSender1_1").attr('checked',true);
| |
− | }else{
| |
− | $("#MailContentSender1_0").attr('checked',true);
| |
− |
| |
− | ↓
| |
− |
| |
− | $("#MailContentSender1a1").attr('checked',true);
| |
− | }else{
| |
− | $("#MailContentSender1a").attr('checked',true);
| |
− | </pre>
| |
− |
| |
− | 60行目
| |
− | <pre>
| |
− | if($('input[name="data[MailContent][sender_1_]"]:checked').val() == '1'){
| |
− |
| |
− | ↓
| |
− |
| |
− | if($('input[name="data[MailContent][sender_1a]"]:checked').val() == '1'){
| |
− | </pre>
| |
− |
| |
− | 135行目
| |
− | <pre>
| |
− | echo $this->BcForm->input('MailContent.sender_1_', array(
| |
− |
| |
− | ↓
| |
− |
| |
− | echo $this->BcForm->input('MailContent.sender_1a', array(
| |
− | </pre>
| |
− |
| |
− |
| |
− | ※ baserCMS 3.0.15で確認、baserCMS4系はこちらのサーバで動作しないので未確認。
| |
| | | |
| | | |
行688: |
行484: |
| | | |
| === PHPバージョン切り替え === | | === PHPバージョン切り替え === |
− | 参考: https://www.just-size.net/support/manual_php.php#change_ver | + | 参考: http://www.just-size.net/support/manual_cgi_ssi_php.php#php |
| | | |
| <pre> | | <pre> |
− | PHP 7.1.x の場合 AddHandler php7.1-script .php | + | PHP 5.6.x の場合 AddHandler php5.6-script .php |
− | PHP 7.2.x の場合 AddHandler php7.2-script .php
| + | PHP 7.0.x の場合 AddHandler php7.0-script .php |
− | PHP 7.3.x の場合 AddHandler php7.3-script .php | + | |
| </pre> | | </pre> |
| | | |
| [[Category:利用ガイド]] | | [[Category:利用ガイド]] |