Forum Discussion
iRule to add www to https traffic?
I have an iRule that looks like this:
when HTTP_REQUEST { if { [HTTP::host] equals "mywebsitehere.com" } { HTTP::respond 301 Location ".[HTTP::host][HTTP::uri]" } }
The problem is that what happens is I get http://www.mywebsitehere.com not https://www.mywebsitehere.com.
So my rule is adding the www which is what I want but not maintaining the https.
Anyone know what I'm doing wrong?
This rule is being applied to a VS that is listening for https traffic.
1 Reply
- Vijay_E
Cirrus
Your iRule looks good. I am guessing the servers have a redirect set up in such a way that when they see ";, they are redirecting to the http:// version over one or more redirects.
I would recommend using CURL to identify the HTTP response to the HTTP request: https://mywebsitehere.com. Based on the redirect "Location", repeat the CURL commands to identify the subsequent responses.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com