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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:56:35+00:00 2026-06-04T00:56:35+00:00

Sorry for the vague title, the problem is too complex to summarize in a

  • 0

Sorry for the vague title, the problem is too complex to summarize in a short phrase…

I’m trying to set up the following redirection rules:

  1. blog.mydomain.net/en/something: redirected to www.mydomain.com/something
  2. blog.mydomain.net/fr/something: redirected to www.mydomain.fr/something
  3. blog.mydomain.net/*: redirected to www.mydomain.com

Rule 3 is working, but rules 1 and 2 seem to be skipped so rule 3 is always applied. Here are my web.config rules:

<!-- Canonicalize mydomain.com to www.mydomain.com -->
<rule name="CanonicalHostNameRule_en" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_HOST}" pattern="^mydomain\.com$" />
    </conditions>
    <action type="Redirect" url="http://www.mydomain.com/{R:1}" />
</rule>

<!-- Canonicalize mydomain.fr to www.mydomain.fr -->
<rule name="CanonicalHostNameRule_fr" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_HOST}" pattern="^mydomain\.fr$" />
    </conditions>
    <action type="Redirect" url="http://www.mydomain.fr/{R:1}" />
</rule>

<!-- Redirect blog.mydomain.net/en/something to www.mydomain.com/something -->
<rule name="RedirectBlog_en" enabled="true" stopProcessing="true">
    <match url="^/en(/.*)?$" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_HOST}" pattern="^blog\.mydomain\.net$" />
    </conditions>
    <action type="Redirect" url="http://www.mydomain.com/{R:1}" />
</rule>
<!-- Redirect blog.mydomain.net/fr/something to www.mydomain.fr/something -->
<rule name="RedirectBlog_fr" enabled="true" stopProcessing="true">
    <match url="^/fr(/.*)?$" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_HOST}" pattern="^blog\.mydomain\.net$" />
    </conditions>
    <action type="Redirect" url="http://www.mydomain.fr/{R:1}" />
</rule>

<!-- Redirect blog.mydomain.net/* to www.mydomain.com -->
<rule name="RedirectBlog_other" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{HTTP_HOST}" pattern="^blog\.mydomain\.net$" />
    </conditions>
    <action type="Redirect" url="http://www.mydomain.com/" />
</rule>

<!-- WordPress-specific rules -->
...

I don’t understand why rules RedirectBlog_en and RedirectBlog_fr are skipped; I tested the regular expressions and they work fine.

Can anyone spot the problem?


EDIT: if I disable the 3rd rule (RedirectBlog_other), then rules 1 and 2 work fine… how is it possible, since rules 1 and 2 are executed before rule 3?

  • 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-04T00:56:36+00:00Added an answer on June 4, 2026 at 12:56 am

    OK, I got it!

    First, things weren’t happening as I thought; rules 1 and 2 were not working when I disabled rule 3: I was still redirected to my actual domain, but this was done by WordPress, not by my rules.

    Second, my pattern for matching the URL was wrong: the leading ‘/’ is not included in the input, so my rules weren’t matching at all.

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

Sidebar

Related Questions

Sorry for the vague title, as I really can't explain this problem succinctly. Basically
Sorry about a vague title, but here's what i am trying to do. I
Sorry for the vague title, but I wasn't sure how to summarize this in
Sorry for the vague title, I didn't know how else to phrase this. Suppose
Sorry for the vague title. I'll explain what I'm trying to get working. My
Sorry for the vague title, but not quite sure how to summarize this one.
Sorry if the title is a little vague, I have the following sceneraio: I
Sorry for vague question title. I've got a table containing huge list of, say,
Sorry for the long and yet still somehow vague title! A friend of mine
Sorry about the extremely vague question title (any suggestions for improvements welcome) I have

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.