IP and URL analysis in IIS 10

Sergey Knyazev 0 Reputation points
2025-02-10T19:12:11.33+00:00

Good afternoon! It is necessary to filter connections to the server by IP address and the presence of a certain phrase in the URL. For example, there are two users: one connects by URL https:\animals.eu\cats\1513515 , and the other one connects by URL https:\animals.eu\dogs\43434 . I need to analyze the ip address from which the connection is going on, and then if the URL contains \dogs, then prohibit access to it, display a separate page. In other cases, allow connection. Is it possible to do this via IIS 10 version?

Internet Information Services
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,701 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. XuDong Peng-MSFT 11,181 Reputation points Microsoft Vendor
    2025-02-11T08:48:48.7133333+00:00

    Hi @Sergey Knyazev,

    It is necessary to filter connections to the server by IP address and the presence of a certain phrase in the URL.

    There are two directions:

    1. If you filter by IP address, you can use the IP and Domain Restrictions module.
      1. Select your website -> double click module IP and Domain Restrictions -> Add Deny Entry... - > Enter the <IP address you want> in Specific IP address textbox.
    2. If you filter by URL, you can use the URL Rewrite module.
      1. Download and install URL Rewrite Module via: https://www.iis.net/downloads/microsoft/url-rewrite
      2. Open the URL Rewrite module, Click the Add Rules option, select Request Blocking rule template and click the OK button.
      3. Set configuration like this (You can modify it according to your needs): User's image
      4. Click "OK" to finish the configuration.

    For more details, you can refer to relevant docs: https://learn.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

    Best regards,

    Xudong Peng


    If the answer is the right solution, please click "Accept Answer" and kindly upvote. 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.


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.