Forum Discussion
Alexis_Verb__23
Jul 01, 2011Nimbostratus
Irule redirect --> problem with character "#"
Hello,
I'm facing trouble with creating a simple redirect irule. I want to redirect everthing from http://mywebsite.com/{sth} to http://www.mywebsite.com/{sth}.
Here is the irule I...
Colin_Walker_12
Jul 01, 2011Historic F5 Account
It looks like you're making this a lot more complicated than it needs to be, unless I'm missing something. If all you want to do is ensure there is always a www on the host, all you'd need is:
when HTTP_REQUEST {
if{[HTTP::host] eq "mywebsite.com"] {
HTTP::redirect "http://www.mywebsite.com[HTTP::uri]"
}
}
That should take care of it for you regardless of the URI.
If there is something more complicated that you're trying to do, I missed it. Let me know what it is and I'll take a look.
Colin
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects