使用環境
modx 0.9.6.3
Encryption 1.0.2
専用SSL
Joe’s レンタルサーバー
まずはこちらから Encryption_1.0.2.txt をダウンロードします。
http://www.modxcms.com/Encryption-1229.html
このスニペットは専用SSL および共有SSL で利用できます。実行時の注意点として暗号化を利用するページは「キャッシュを生成」のチェックははずしておきます。
専用SSL の場合は案外あっさりと設定できました。共有SSL の coreserver の場合はいまだに現在格闘中です。あとで泣きついた時にはよろしくお願いします。
Encryption を使った場合でも base_url の問題は別に解決する必要があります。
また専用SSL を使った場合には eForm の画像認証へのリンクが https:// になっているようで問題ないようです。
Installation
1. Copy the text file into a new snippet called "Encryption".
ダウンロードが完了したらテキスト内容をスニペットに貼り付け Encryption という名前で保存します。
2. Edit the $secureserver parameter to match the location of your site when it is encrypted. For example
https://www.hostingco.com/~foo.
SSLでアクセスするサーバーのアドレスを指定します。
最後の / は不要です。
$secureserver = "
https://www.example.com" と入力。
3. Edit the $unsecureserver parameter to match the location of your site when it is not encrypted. For example
http://www.foo.com.
http:// でアクセスするサーバーのアドレスを modx のルートディレクトリまで含めて指定します。
最後の / は不要です。
$unsecureserver = "
http://www.example.com/modx
Using a Template Variable
1. Create a template variable called "encryption" that is a checkbox. The "input option values" should be "On" (capital O) or 1. The default value should be "Off" or 0.
テンプレート変数を作成します。
変数名:encryption
入力タイプ:Check Box
入力時のオプション値:「ページを暗号化する場合にはチェックしてください」とかなんとか
既定値:0
2. Add the template variable to templates.
暗号化を利用したいテンプレートを選択しチェックして、テンプレート変数の設定を保存します。
3. At the top of each template add the call to the snippet. For example:
使用したいテンプレートの先頭にスニペットの呼び出しを記入します。
[[Encryption]]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4. Edit the documents to be encrypted and check the encryption checkbox.
暗号化したいドキュメントを編集し、暗号化のチェックボックスをチェックしてください。
Friendly URLs
htaccess の設定変更は特に必要ありません。あってもなくても動作に違いはないようです。
次回、共有SSL が設定できればあらためて報告いたします。