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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:21:42+00:00 2026-06-04T01:21:42+00:00

Evening, I’ve been tasked with moving a website from subdomain.domain.com to domain.com/subdomain. Issues I

  • 0

Evening,

I’ve been tasked with moving a website from subdomain.domain.com to domain.com/subdomain.

Issues I have:

Both the original subdomain and and the domain name have url rewriting rules (asp.net, UrlReWriter)

So, I’ve moved (or rather, copied) the subdomain content files to the new subfolder under the main domain and things seem to be going really well but having one or two issues…

I need to match the following:

http://www.maindomain.com/category.aspx?name=foo -> http://www.maindomain.com/foo/
http://www.maindomain.com/viewproduct.aspx?catName=foo&productName=bar -> http://www.maindomains.com/foo/bar.aspx

I kind have already got that bit working but, because of config file inheritance, i have to specify the rewrite rules in the main application (main domains) web.config so I need to also match these rules:

http://www.maindomain.com/us/category.aspx?name=foo -> http://www.maindomain.com/us/foo/
http://www.maindomain.com/us/viewproduct.aspx?catName=foo&productName=bar -> http://www.maindomain.com/us/foo/bar.aspx

Obviously, the rewrite engine needs to ignore css/images other files etc, including for example:

http://www.maindomain.com/about.aspx & http://www.maindomain.com/us/about.aspx

Need any other info, just ask..

The rules I have at the moment are:

    <rewrite url="^(/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js)(\?.+)?)$" to="$1" processing="stop"/>
<rewrite url="^/us/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js)(\?.+)?$" to="$1" processing="stop"/>

<rewrite url="^/us/Error.aspx" to="$1" processing="stop"/>
<rewrite url="^/us/Error404.aspx" to="$1" processing="stop"/>

<rewrite url="Error.aspx" to="$1" processing="stop"/>
<rewrite url="Error404.aspx" to="$1" processing="stop"/>

    <rewrite url="^/us/$" to="$1" processing="stop"/>
<rewrite url="^/us/(.+)/(.+).aspx" to="/us/viewProduct.aspx?productName=$2&amp;catName=$1" processing="stop"/>
<rewrite url="^/us/(.+)/" to="/us/category.aspx?name=$1" processing="stop"/>

<rewrite url="^/(.+)/(.+).aspx" to="~/viewProduct.aspx?productName=$2&amp;catName=$1" processing="stop"/>
<rewrite url="^/(.+)/" to="~/category.aspx?name=$1" processing="stop"/>

Using, iis7.5, c#, asp.net v2
Thanks
Michael

  • 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-04T01:21:44+00:00Added an answer on June 4, 2026 at 1:21 am

    There’s a few issues here. The first is that the following rewrite rule can’t work:

    <rewrite url="^/us/$" to="$1" processing="stop"/>
    

    You’re asking the rewrite module to replace the url /us/ with match group one, but you don’t have a group in your capture expression. To fix this, and to deal with .aspx files in tha /us/ folder, replace it with the following two rules:

    <rewrite url="^/us/$" to="/us/default.aspx" processing="stop"/>
    <rewrite url="^(/us/[^/]+\.aspx)$" to="$1" processing="stop"/>
    

    In addition, your second rewrite rule (for static content in the /us/ folder) isn’t needed, because the first rewrite rule doesn’t care what folder the file is in, and will match (and stop processing) for urls such as /us/images/foo.jpg.

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

Sidebar

Related Questions

Good evening, I have a website with a current css optimized for a desktop
Good Evening, The problem is that i have both xcode 3.2 and xcode 4
Good evening/morning/after/noon. I have an ASP.net 3.5 website and I am using vb.net in
Evening folks!! Stuck with this rather dull problem. I have deployed my website on
Evening all, I have the following SQL Query for PDO: DELETE FROM group_members WHERE
Evening, I'm currently running this query: SELECT `id`, `type`, `controller` FROM `urls` WHERE `url`
Evening I have two tables: urls & places. To simplify, the data is like
Evening, Is there a common or standardised name given to a function or method
Good evening, In my app that I'm currently developing, I have a class that
Good evening. For a project, I have to create a system. In this system,

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.