Forum Discussion

D99's avatar
D99
Icon for Cirrus rankCirrus
Apr 21, 2021

Redirect URI with "admin" to original URL

Hi Experts,

 

I have a requirement that when external users access https://abc.com/admin/* it should redirect them to https://abc.com. This shouldnt take effect for private IP's i.e for internal users admin url should open.

 

Please let me know how can I achieve this either with irule or http policy

 

 

1 Reply

  • Modify data group name accordingly.

    when HTTP_REQUEST {
    	    switch -glob [string tolower [HTTP::uri]] {
    	    	"/admin*" 
    			{
    		    if { ![class match [IP::client_addr] equals internal_ip] } {
    		    HTTP::respond 301 Location "https://abc.com"
    	                }
    			} default {
                      return
    	      }
                }
    	}