To achieve this, we used tuckey url rewrite framework to block the IP based access. The framework is already bundled in our application.Follow the below steps to block the IP based access, Assume ServiceDesk Plus server's IP address is "101.102.103.104"
Step 1 : Download the attached urlrewrite.xml file.
Step 2 : Open the urlrewrite.xml file under <SDP Home>\webapps\ROOT\WEB-INF folder. Don't modify the existing content. Copy the rule tags from attached urlrewrite.xml and paste those contents in urlrewrite.xml in last (before </urlrewrite.xml> line).
NOTE: If the urlrewrite.xml file is not exists, Save the attached urlrewrite.xml file under <SDP Home>\webapps\ROOT\WEB-INF directory.
Step 3: Replace the "101.102.103.104" IP address with ServiceDesk application installed server's IP address. Also don't remove the special chars added back and forth of IP Address.

Step 4 : Replace the acme.com with domain name used to access the ServiceDesk Plus application.
Step 5 : Open the web.xml file under <SDP Home>\webapps\ROOT\WEB-INF folder. Add or edit (if exists) the below filter-mapping details in web.xml in all the below context folders. This filter must added after SDPSecurityFilter.
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
NOTE: If filter mapping exists, the url-pattern (<url-pattern>/portal/*</url-pattern>) will be different and no dispatchers.
Step 6 :
(1) Need to copy and paste the current edited urlrewrite.xml to below context folder.
(2) Copy the filter contents from Step 5 and paste into the web.xml in below all context folder.
All Contexts :
- under webapps/ROOT/WEB-INF/ (already done)
- under webapps/sd/WEB-INF/
- under webapps/mc/WEB-INF/
- under logs/WEB-INF/
- under integration/resources/WEB-INF/
- under inlineimages/WEB-INF/
- under fos/WEB-INF/
- under custom/WEB-INF/
Step 7 : Restart the ServiceDesk Plus application server.