Click here to Skip to main content
15,890,385 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<rewrite>
      <rules>
        <rule Name="HTTP to HTTPS Redirection" stopprocessin="True"></rule>
        <match url="(.*)"/>
        <conditions>
          <add input="(https)" patern="off"/>
        </conditions>
        <action type="Redirect" url="https://satya/{REQEST_URI}" redirectType="Found"></action>

      </rules>

    </rewrite>
  </system.webServer>


What I have tried:

I want to rewrite Url http to https but it's give error please any one help me
Posted
Updated 10-Apr-20 4:14am
v2
Comments
F-ES Sitecore 10-Apr-20 10:09am    
If you google "url rewrite module http to https" I'm sure you'll find examples.

1 solution

Perhaps it is because pattern is mis-spelled
XML
<!-- your code --><add input="(https)" patern="off"/>
<!-- typical   --><add input="{HTTPS}" pattern="^OFF$" />
Also... you may want to change the redirectType attribute to Permanent; this will generate a 301 Permanent Redirect as opposed to a 302 Found response.
This is good for SEO purposes as well:
1. Search Engines will give you credit for using an SSL
2. Search Engines will index the HTTPS version and not the insecure version
3. Browsers cache the 301 response, and will not ask for the insecure URL in the future
 
Share this answer
 
v2
Comments
satyanand mishra 11-Apr-20 14:10pm    
Thanks for Reply I did but it's still give Error in my web Config file
The Element Web.Server has invalid child element rewrite .I am using Visual Studio 10 and IIS 8.5
MadMyche 11-Apr-20 19:56pm    
Try commenting out the rewrite chunk of code, to see if this the rest of the config is good
satyanand mishra 11-Apr-20 23:40pm    
I checked everything is fine but It's still give same error the element wev.server has invalid child element
MadMyche 11-Apr-20 23:44pm    
Well you are going to have to figure which section is bad, most likely by commenting out blocks and seeing when the error goes away or changes

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900