Pages can't edit After set rule in IIS for redirecting to HTTPS
Hi,
After I set rule in URL rewrite in IIS, users can't edit for every single page from backend sitefinity.
The following error was shown when click on "saveasdraft" button when they edit to pages.
The content type text/html; charset=UTF-8 of the response message does not match
the content type of the binding (text/xml; charset=utf-8). If using a custom encoder,
be sure that the IsContentTypeSupported method is implemented properly.
The first 1024 bytes of the response were:
'<HTML><HEAD><link rel="alternate" type="text/xml"
href="www.nac.gov.sg/.../PagesApprovalWorkflow.xamlx
<STYLE type="text/css">#content FONT-SIZE: 0.7em; PADDING-BOTTOM: 2em; MARGIN-LEFT: 30px
BODYMARGIN-TOP: 0px; MARGIN-LEFT: 0px; COLOR: #000000; FONT-FAMILY: Verdana; BACKGROUND-COLOR: white
PMARGIN-TOP: 0px; MARGIN-BOTTOM: 12px; COLOR: #000000; FONT-FAMILY: Verdana
PREBORDER-RIGHT: #f0f0e0 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #f0f0e0 1px solid;
MARGIN-TOP: -5px; PADDING-LEFT: 5px; FONT-SIZE: 1.2em; PADDING-BOTTOM: 5px;
BORDER-LEFT: #f0f0e0 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f0f0e0 1px solid;
FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e5e5cc.heading1MARGIN-TOP: 0px;
PADDING-LEFT: 15px; FONT-WEIGHT: normal; FONT-SIZE: 26px; MARGIN-BOTTOM: 0px;
PADDING-BOTTOM: 3px; MARGIN-LEFT: -30px; WIDTH: 100%; COLOR: #ffffff;
PADDING-TOP: 10px; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #003366.
introMARGIN-LEFT: -15px</STYLE><TITLE>ContentApprovalWorkflow Service</TITLE></H'.
But only after disable the rule in IIS, we can edit the page.
How to URL rewrite without effecting to page editing.
In web.config, I use the following code to rewrite the rules:
<rewrite>
<rules>
<rule name = "HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)"/>
<conditions>
<add input = "HTTPS" pattern="off" ignoreCase="true"/>
</confitions>
<action type="Redirect" redirectType="Found" url="https://HTTP_HOST/R:1" />
</rules>
</rules>
</rewrite>
Now I disable the rule for redirect HTTPS in IIS. But I still need to redirect to HTTPS.
Even I set "Require SSL" in IIS, I have 403 error. So I did not set the "Require SSL" option in IIS.
Just only set for "Require SSL" in sitefinity backend page.
Which method should I use to redirect to HTTPS.
Please, can anyone give me idea or advice relate with this issue.
Thanks in advance.
Hello,
For redirection to SSL you can find detailed instructions how to configure SSL with Sitefinity in our Knowledge base. Please check this article. Each sitefinity page have a page property require SSL, go to Actions->Title & Properties of a page check the checkbox require ssl, the site must have binding in IIS for https on port 403 and the settings from the KB article to support SSL, this will remove the need to have a rewrite rule. Please let me know if the approach works for you.
Regards,
Ferdi Nebiev
Telerik