Rustic_57941
Oct 17, 2013Nimbostratus
Inserting "www" or redirecting to "www"
Hi,
My client has changed their back end servers from Coldfusion to Liferay. The Tomcat within the new Liferay only accepts "http://www.example.com" so when users try "http://example.com" it fails. So I wrote a basic iRule to redirect the users browser to use "www" in the request. Mostly it works fine, but the URI is lost and I'm really sure if this is the correct way to this.
Any suggestions?
Thanks!
iRule is:
when HTTP_REQUEST { set host [HTTP::host] if { [HTTP::host] equals "example.com" } { HTTP::respond 301 Location "http://www.$host/" } }