URL Rewrite (IIS 10) - Redirection between URLs on the same network

FelipeSantosBRA 61 Reputation points
2024-01-31T10:43:23.7766667+00:00

Hi,

I need help creating the following redirect in IIS 10 (Win Server 2019 DTC):

"name.domain.com" to "http://192.168.0.1/service"

In the DNS Server (integrated with AD), I have already created the A record that resolves "nome.domain.com" to the WEB Server's IP. I have also created a rule in URL Rewrite (default site level) that should perform the redirection informed. However, when carrying out the test in any browser, only the IIS 10 home page is loaded, that is, the redirection does not work.

The IIS server was only created for this purpose. And all hosts are on the same single-domain network and on a single VLAN (the default).

Below is the rule created in URL Rewrite (standard site level):

Name: Service Redirection

Match URL:

  • Requested URL: Matches the Pattern
  • Using: Wildcard
  • Pattern: name.domain.com
  • Ignore case: checked

Conditions:

  • Logical grouping: Match All
      (no condition added)
    

Server Variables:

     (not configured)

Action:

Are there any errors in this rule?

Thanks.

Windows development | Internet Information Services
Windows for business | Windows Server | User experience | Other
{count} votes

Accepted answer
  1. Sam Wu-MSFT 7,561 Reputation points Microsoft External Staff
    2024-02-01T03:28:28.8866667+00:00

    @FelipeSantosBRA Do you have access to name.domain.com? If you can, you can try the following rule:

    <rule name="test" stopProcessing="true">    
      <match url="(.*)" />      
        <conditions>          
          <add input="{HTTP_HOST}" pattern="name.domain.com" />      
        </conditions>    
      <action type="Redirect" url="http://IP address/service" redirectType="Permanent" /> 
    </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.

    1 person found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. FelipeSantosBRA 61 Reputation points
    2024-02-01T17:47:21.81+00:00

    I'll run a test and get back to you soon.

    0 comments No comments

  2. FelipeSantosBRA 61 Reputation points
    2024-02-01T19:25:16.1066667+00:00

    Hi. Unfortunately, it didn't work. Please see the prints for verification: https://1drv.ms/u/s!Ano4lKaa9hT7ha8nir3s-A5FzfW85A?e=xdhZX9. Where is the error?


  3. FelipeSantosBRA 61 Reputation points
    2024-02-23T20:23:05.33+00:00

    Thank you all.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.