Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7716469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:38:44+00:00 2026-06-01T02:38:44+00:00

Whenever someone makes request over HTTP protocol I rewrite the url to make it

  • 0

Whenever someone makes request over HTTP protocol I rewrite the url to make it HTTPS. This is the code in web.config:

<rule name="Imported Rule 1-1" enabled="true" stopProcessing="true">
    <match url="^(?!https://).*" ignoreCase="false" />
    <conditions logicalGrouping="MatchAll">
        <add input="{SERVER_PORT}" pattern="80" ignoreCase="false" />
    </conditions>
    <action type="Rewrite" url="https://abc.com/{R:1}" />
</rule> 

However when I browse on http:// I get IIS error

HTTP Error 500.50 – URL Rewrite Module Error. The expression "https://abc.com/{R:1}" cannot be expanded.

How can I resolve this? I am utterly confused.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:38:45+00:00Added an answer on June 1, 2026 at 2:38 am

    The matches are zero based.

    <action type="Rewrite" url="https://abc.com/{R:1}" />
    

    Won’t work because you only have one match. You need:

    <action type="Rewrite" url="https://abc.com/{R:0}" />
    

    Also, this won’t work, because you can only match on the path below the site root.

    <match url="^(?!https://).*" ignoreCase="false" />
    

    It looks like you are checking for ssl. Try this instead:

          <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{HTTPS}" pattern="^OFF$" />
          </conditions>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I purchased a domain: josecvega.com Whenever someone tries to access http://www.josecvega.com it forwards them
I updated my User class, and now whenever someone that had the old version
My server time is in GMT, and I do the following whenever someone comes
I'm doing some work for a charity that's having a fund drive. Whenever someone
I've created an overlay that will popup whenever someone wants to upload a file
I'm trying to make a list containing names. This list should be modifiable (add,
I have a project where I need to make secure transactions on a HTTP
I need to make a kext which does a very simple function. Whenever a
I'm using the following ajax function: function callAjax(request,callback) { if (window.XMLHttpRequest) {// code for
I am inheriting some ASP.NET code (I am an OS guy, not a web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.