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

  • Home
  • SEARCH
  • 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 4114294
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:26:14+00:00 2026-05-20T22:26:14+00:00

I have been trying to get the IIS URL Rewrite engine to work for

  • 0

I have been trying to get the IIS URL Rewrite engine to work for a specific case of outbound URLs. I am trying to lowercase all URLs except for those that match these criteria:

  • An outbound link with a hash tag: page.aspx#q=MixedCaseParameter
  • An already rewritten outbound friendly URL with a mixed case product id and product description: /shopping/product/A12345/Mixed-Case-Product-Description
  • An outbound link with javascript: in the HREF instead of a URL: javascript:__doPostBack(‘control’,’action’)

I can do parts of it, but not all of it in one expression, but I can’t get all three. Here is what I have right now:

([A-Z]+)((?:(?!app\.aspx#q).)|(?:^(?!javascript:).))

And the settings in the web.config:

<rewrite>
  <!-- other rules excluded for clarity -->
  <outboundRules rewriteBeforeCache="true">

    <rule name="Outbound lowercase" preCondition="IsHTML" enabled="true">
      <match filterByTags="A" pattern="([A-Z]+)((?:(?!app\.aspx#q).)|(?:^(?!javascript:).))" ignoreCase="false" />
      <action type="Rewrite" value="{ToLower:{R:0}}" />
    </rule>

    <!-- Example friendly outbound rewrite rule -->
    <rule name="Rewrite Product Outbound" preCondition="IsHTML" enabled="true" stopProcessing="true">
      <match filterByTags="A" pattern="product\.aspx\?cat=catalogname&amp;amp;pid=([0-9a-zA-Z\-]+)&amp;amp;pdisplayname=([0-9a-zA-Z\-]+)" ignoreCase="true" />
      <action type="Rewrite" value="/shopping/product/{R:1}/{R:2}" />
    </rule>

    <preConditions>
      <preCondition name="IsHTML" logicalGrouping="MatchAny">
        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
      </preCondition>
    </preConditions>
    <!-- Shopping Outbound Rules End -->
  </outboundRules>
</rewrite>

Thanks.

  • 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-05-20T22:26:15+00:00Added an answer on May 20, 2026 at 10:26 pm

    Here is a regex that will match the three types of outbound urls you don’t want to lowercase :

    .*?page\.aspx#q|.*?/shopping/product|^javascript:

    Test :

    page.aspx#q=MixedCaseParameter                              => Matched
    /shopping/product/A12345/Mixed-Case-Product-Description     => Matched
    javascript:__doPostBack('control','action')                 => Matched 
    http://google.com                                           => NOT Matched
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get the Fusion Charts to work on Android 2.2
So I have been trying for hours to get this to work and I
I have been trying to get around this error for a day now and
I have been trying to get more in to TDD. Currently keeping it simple
I have been trying for a long time to get SQL Server Express on
I have been having some problems trying to get my PHP running. When I
I have been trying to determine a best case solution for registering a COM
I have been trying to work my way through Project Euler, and have noticed
I have been trying to get SqlCacheDependency working. I think I have everything set
I have been trying to deploy my asp.net mvc site to IIS 7 and

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.