That has already been posted inside the comment of an older project but I thought this would be useful as an own post because it shows very good how to create a switch for SSL within the Open Text Websolutions Delivery Server 9.
<reddot:cms> <if> <query valuea="Context:CurrentRenderMode" operator="==" valueb="Int:2"> <if> <query valuea="Context:CurrentPage.Elements.GetElement(opt_secure).GetHtml()" operator="==" valueb="String:ssl"> <htmltext> <rde-dm:attribute mode="condition" source="request" attribute="rdeServletServer" op="contains" value="80"> <rde-dm:process mode="redirect" url="[#request:rdeHttpsServer#]/[#request:rdeCurrentXmlId#]" status="301" /> </rde-dm:attribute> </htmltext> </query> <query type="else"> <htmltext> <rde-dm:attribute mode="condition" source="request" attribute="rdeServletServer" op="contains" value="443"> <rde-dm:process mode="redirect" url="[#request:rdeHttpServer#]/[#request:rdeCurrentXmlId#]" status="301" /> </rde-dm:attribute> </htmltext> </query> </if> </query> </if> </reddot:cms>
<query valuea="Context:CurrentRenderMode" operator="==" valueb="Int:2">
<query valuea="Context:CurrentPage.Elements.GetElement(opt_secure).GetHtml()" operator="==" valueb="String:ssl">
<rde-dm:attribute mode="condition" source="request" attribute="rdeServletServer" op="contains" value="80">
<rde-dm:attribute mode="condition" source="request" attribute="rdeServletServer" op="contains" value="80">
The redirect works in both directions so that you can switch easily from HTTP to HTTPS or when you already are in SSL mode back from HTTPS to HTTP. Questions?
Nice solution if the Delivery Server is exposed to the Internet.
I had a similar ssl/non-ssl issue to solve recently and have used an Apache mod_rewrite approach.
port 80 config width:
RewriteCond %{REQUEST_URI} ^/cps.*-ssl.html [NC] RewriteRule ^/(.*)$ https://my.website.de/$1 [NE,NC,R=permanent,L]
port 443 config:
RewriteCond %{REQUEST_URI} ^/cps/.*.html [NC] RewriteCond %{REQUEST_URI} !^/.*-ssl.html [NC] RewriteRule ^/(.*)$ http://my.website.de/$1 [NE,NC,R=permanent,L]
So the opt_secure is here the -ssl.html in the file name.