5

Is it possible to redirect people from http to https in the same instance of the Tridion CME? What I am trying to say is my CME is available at http://mycms.com and I have added SSL to it so now I have a new url, https://mycms.com.

I want all my old users who have been using http to be redirected https when they try to log into Tridion.

I have tried many methods using URL rewrite and Custom Errors and none worked. I usually get an error that Tridion cannot find Editor.axpx.

Is this even possible on the same Tridion IIS instance?

6 Answers 6

10

If you're using IIS 7.5 and have the redirect module installed, you could add something like this to the SDL Tridion web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="HTTP/S to HTTPS Redirect" enabled="true" stopProcessing="true">
        <match url="(.*)" />
        <conditions logicalGrouping="MatchAny">
          <add input="{SERVER_PORT_SECURE}" pattern="^1$" />
          <add input="{SERVER_PORT_SECURE}" pattern="^0$" />
        </conditions>
        <action type="Redirect" url="https://{HTTP_HOST}/OWA/" redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

This basically tells the url to redirect from 0 (insecure: pattern="^0$") to 1 (secure: pattern="^1$")

This would mean modifying the installed web.config, but it would catch links to direct items, failing that perhaps it's possible to move the urls into two websites and have one do an auto redirect to the other.

1
  • This does not work correctly for Tridion. See the answer below from @Kunle for a redirect pattern that does work. That patterns should be added to the SDL Tridion website in IIS. The key is the negation of the files, as without that Tridion will respond with a 401 unauthorized and/or 500 response for some of the UI requests that are made.
    – javamate
    Commented Apr 28, 2017 at 14:20
2

This is not really a Tridion specific question, you should configure IIS to perform this redirection. Take a look at this sample: https://stackoverflow.com/questions/17409800/redirect-website-from-http-to-https

If this does not help, please post your specific version of Tridion and Windows Server and IIS.

2

This code got it working, thanks guys.

<rule name="HTTP to HTTPS redirect" stopProcessing="true">
 <match url="(.*)" />
   <conditions>
     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
     <add input="{HTTPS}" pattern="off" ignoreCase="true" />
    </conditions>
   <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
 </rule>

Even though this has nothing to do with Tridion, I still had to negate files so that css and javascripts in Tridion can load. Without that it did not work.

2
  • 1
    This one worked over your other answer? Maybe merge these into one answer so it's easier to see follow what worked (or didn't) for this setup. Commented Nov 12, 2013 at 19:45
  • @AlvinReyes Yes, this works over the other answer provided by johnwinter. The key, as Kunle indicated, is to negate the files, otherwise Tridion responds with 401 and/or 500 errors when requesting certain UI elements (data). At least that is my experience with Tridion 2013SP1 HR1.
    – javamate
    Commented Apr 28, 2017 at 14:26
1

We needed do the same thing, but we have an F5 Load Balancer fronting a two node CM cluster. We have SSL termination at the F5 VIP and force the SSL connection on URL.

1

Instead of applying redirects to the Tridion website directly, I've created auxiliary website with following binding: Binding for Tridion website

and then using HTTP redirect feature of IIS: enter image description here

Version of Tridion: SDL Web8 IIS: 8.5 OS: Windows server 2012

0

Thanks for your reply guys, I agree this is not specific to Tridion hence I assumed it to be quite straight forward. This is the code I used , the redirect works, but when tridion loads I get an error "remote server is not authorized. and all the publications do not load. I added this code to Tridion/web/web.config

<rule name="HTTP to HTTPS redirect" stopProcessing="true">
 <match url="(.*)" />
   <conditions>
     <add input="{HTTPS}" pattern="off" ignoreCase="true" />
   </conditions>
  <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
 </rule>

The main reason I posted this here is just to check if there are any spec changes I need to make in some of the other web.config files. Tridion version is T2011 with the Hotfix rollup installed. If i go dirrectly to https:/mycms it works perfectly, so all the changes to make tridion work with https is done.

John thanks for your answer when I used your code the redirect fell into a loop.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.