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 337287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:19:19+00:00 2026-05-12T10:19:19+00:00

Hey all, I’ve got a question about IIS7 rewrite. I’m wondering if there is

  • 0

Hey all, I’ve got a question about
IIS7 rewrite.

I’m wondering if there is a way to set
conditions for re writing urls. I’m
wanting to rewrite:

http://www.domain.com/user.aspx?id=username

to become

http://www.domain.com/username/

I also have

http://www.domain.com/article.aspx
http://www.domain.com/login.aspx

and I want those to become

http://www.domain.com/article/
http://www.domain.com/login/

The issue I’m having is that if I set
up the rewrites for username the
rewrites for article and login break.

I need to somehow exclude those from
the username rewriting so that they
can be handled on their own.

Here is my current code, im rewriting
the usernames to /user/username at the
moment:

<rewrite>
  <rules>
    <rule name="Rewrite user accounts2">
      <match url="user/([_0-9a-z-]+)"/>
      <action type="Rewrite" url="user.aspx?id={R:1}"/>
    </rule>
    <rule name="Rewrite user accounts">
      <match url="user/([_0-9a-z-]+)/"/>
      <action type="Rewrite" url="user.aspx?id={R:1}"/>
    </rule>
  </rules>
</rewrite>
  • 1 1 Answer
  • 2 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-12T10:19:19+00:00Added an answer on May 12, 2026 at 10:19 am

    If you add the article/login rule at the top and add stopProcessing=”true” to it then you dont have to use conditions.

    <rewrite>
      <rules>
        <rule name="Login" stopProcessing="true">
          <match url="login/?"/>
          <action type="Rewrite" url="login.aspx"/>
        </rule>
        <rule name="Article" stopProcessing="true">
          <match url="article/?"/>
          <action type="Rewrite" url="article.aspx"/>
        </rule>
        <rule name="Rewrite user accounts2" stopProcessing="true">
          <match url="user/([_0-9a-z-]+)/?"/>
          <action type="Rewrite" url="user.aspx?id={R:1}"/>
        </rule>
      </rules>
    </rewrite>
    

    PS. the questionmark makes the preceding character optional.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all. Is there a way to copy only a portion of a single
Hey all, I am wondering what the best way to do the following is:
Hey all i am wondering why my code below is only writing the first
Hey all, just wondering what the best way to add this capability was. I
Hey all is there any way to query a text file using OleDB or
hey all my question about how the developers makes their interface the buttons, slider,
hey all, i have a question about urlmapping in grails. I'm trying to make
hey all, is there any way to convert a given file (this could be
Hey all. I'm wondering how to implement a timeout event in the System.Windows.Forms.Webbrowser control?
Hey all. Ive got a headache trying to get my head around this. I

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.