Forum Discussion

CSA's avatar
CSA
Icon for Nimbostratus rankNimbostratus
Mar 23, 2010

Re: Adding www. before HTTP::host / regexp matching

Answering myself:

 

 

when HTTP_REQUEST {

 

if { [ string tolower [HTTP::host] ] matches_regex {^\w\w\.domain\.com$} } {

 

HTTP::redirect "http://www.[HTTP::host]"

 

}

 

}

 

 

Any remarks are welcome if I did something wrong.

 

No RepliesBe the first to reply