// you’re reading...


RedDot LiveServer SSL switch

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.

HTTP to HTTPS switch and vice versa using RedDot LiveServer Delivery Server dynaments

    <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:process mode="redirect" url="[#request:rdeHttpsServer#]/[#request:rdeCurrentXmlId#]" status="301" />
        <query type="else">
            <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" />

How it works

  • Add an option list element opt_secure to your MasterPage template and add an empty option labelled “default” for non-secure pages and a value labelled “Secure page” with the value “ssl” to your RedDot CMS template I wont say Web Solutuions Management Server template this time. funny
  • This line makes sure, that your code is only executed on the published page, to know more about that take a look on one of my older posts
    <query valuea="Context:CurrentRenderMode" operator="==" valueb="Int:2">
  • This line checks if the page should be in SSL mode or not
    <query valuea="Context:CurrentPage.Elements.GetElement(opt_secure).GetHtml()" operator="==" valueb="String:ssl">
  • This tests if the URL contains the port 80 (also in port 8080) and then
    <rde-dm:attribute mode="condition" source="request" attribute="rdeServletServer" op="contains" value="80">
  • Here the visitor is forwarded to the same page in SSL mode and the HTTP header 301 as “permanantly moved” is added
    <rde-dm:attribute mode="condition" source="request" attribute="rdeServletServer" op="contains" value="80">

This is no one way street

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?

Share and Enjoy:
  • Print
  • email
  • Twitter
  • Digg
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • del.icio.us
  • MisterWong
  • Facebook
  • LinkedIn

No related posts.

About the author:

Markus Giesen Markus Giesen is a Solutions Architect and RedDot CMS Consultant, formerly based in Germany. Travelling around the world to find and offer solutions for a better world (in a very web based meaning). He just found a way to do this as part of a Melbourne based online consultant house. On this blog Markus shares his personal (not his employers) thoughts and opinions on CMS and web development. In his spare time you will find him reading, snowboarding or travelling. Also, you should follow him on Twitter!


2 comments for “RedDot LiveServer SSL switch”

  1. 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.

    Posted by Alexander Seidel | May 3, 2009, 8:57 pm
  2. Hey Markus! Great information on LiveServer. You might want to follow Gaurav’s posts about his LiveServer experience/expertise:


    Posted by Kimberly McCabe | May 30, 2009, 12:59 am

Post a comment

Stay up to date! - Get notified about followup comments

If you don't feel the urge to comment but wish to stay in the loop:
Just enter your email and subscribe to new comments.

Subscribe without commenting

Recent Tweets

  • RT @AirKraft: Transport Canada breakout: they manage 80K pages and 300K assets with WSM(RedDot). Wow! #OTCW 2010-11-11
  • The RedDot usergroup session 'Future of WCM' is in National Harbor 7, now. See you there! #otcw 2010-11-11
  • RT @yttergren: @AirKraft: Calling all WSM(RedDot) devs: share your solutions on http://bit.ly/bgPIof EVERY solution can win an iPad #OTCW 2010-11-10
  • Come to the Solution Exchange session. Enhance your (#reddot) CMS project! Chesapeake 12, 3:20pm #otcw Looking forward to see you there! 2010-11-10
  • More updates...