Kemp Support, how can we help?

The latest application delivery knowledge and expertise at your fingertips.

Remove WWW from request





If a user types in, need the www removed.


Product: LoadMaster

Version: Any

Platform:  Any

Application: Any

Question/Problem Description:

Remove www from request.

Steps to Reproduce:  
Error Message:  
Defect Number:  
Enhancement Number:  

There are several options for how to do this:

  • Create a rule using the WUI use the following parameters

Rule type = Replace Header
Header Field = Host
Match String = /^www\.example\.com$/
Replace with =

***Once the rule is created, it will be applied within the Virtual Service configuration under the HTTP Header Modifications as a request rule.


  • Command to create a rule using API


  • Command to create a rule using Powershell


New-AdcContentRule -Credential bal -LBPort $LoadMaster_Port -LoadBalancer $LoadMaster_Address -RuleName $Rule_Name -Type 3 -Header Host -MatchType regex -Pattern /^www\.example\.com$/ -Replacement


  • Using subVSs and a Redirect

Create two SubVSs within the Virtual Servuce.  On one, a Rule to match host header for would be use and this SubVS would perform a 301 permanent redirect to  The second SubVS will have a Rule to match and send traffic to the Real Servers.  This will show the change of removing the www in the browser to the users.



Was this article helpful?
0 out of 0 found this helpful