How to capture parts of my domain into subdirectory

afflifgsdhjs 21 Reputation points
2022-07-29T06:24:01.127+00:00

I want to redirect below url, can anyone help me move my domain name to a subdirectory?

http://www.support.example.com to http://www.example.com/support

Any suggestions are great!

Internet Information Services
0 comments No comments
{count} votes

Accepted answer
  1. Sam Wu-MSFT 7,036 Reputation points Microsoft Vendor
    2022-07-29T08:38:38.583+00:00

    @afflifgsdhjs

    You can try this rule:

    <rule name="Test" stopProcessing="true">  
           <match url=".*" />  
               <conditions>  
                   <add input="{HTTP_HOST}" pattern="^www.(.*)\.example\.com$" />  
               </conditions>  
            <action type="Redirect" url="http://www.example.com/{C:1}/" />  
     </rule>   
    

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful