Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,

I have been trying to convert my http web links to https using rewrite module.
The redirection seems to partially work as the links are converted with https, but then the target url is not as expected.

That is, the original url: http://servername/folder/page_x.aspx
But the converted url drops 'folder' from the path: : https://servername/page_x.aspx

Any help or direction towards the fix is highly appreciated!

What I have tried:

I have tried various combination of target url in the web.config file, but then nothing worked.


Here is the config file:

<configuration>
<configsections>
<sectiongroup name="system.webServer">
<sectiongroup name="rewrite">





<system.webserver>
<defaultdocument>
<files>
<clear>
<add value="index.html">
<add value="Default.htm">
<add value="Default.asp">




<rewrite>
<rules>
<rule name="HTTPS REDIRECT" stopprocessing="true">
<match url="(.*)">
<conditions>
<add input="{HTTPS}" pattern="^OFF$">

<action type="Redirect" url="https://{HTTP_HOST}/{REQUEST_URI}" redirecttype="Found">




Posted

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



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