restful service as both http and https - iis urlrewrite

87 Views Asked by At

Our application is developed in MVC 4 with WCF services. We have installed SSL and website is working fine (default https), But our Restful services are not working in http its showing HTTP 404 The resource cannot be found.

I am using url rewrite as :

<rule name="Https Except Service" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll">
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
        <add input="{REQUEST_URI}" negate="true" pattern="^/(wsserv\.svc.*)" ignoreCase="true" />
        <add input="{REQUEST_URI}" negate="true" pattern="^/(rest\.svc.*)" ignoreCase="true" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>

Our Serice some Get uri as :

/rest.svc/getallcategories
/rest.svc/user-id/cat-id
/rest.svc/user-id/cat-id/sub-catid

service rest.svc is working fine in https but it is not working with http, on http request its showing error HTTP 404 the resource cannot be found.

How to make rest.svc service accessilbe in both http and https ?

0

There are 0 best solutions below