Forum Discussion
Marty_59927
Nimbostratus
Jan 28, 2009iRule - Redirect
I'm trying to redirect from domain1/uri to domain2/uri only if there is no .ext in the uri.
ie:
http://www.domain-1.com/any_subdir will redirect
http://www.domain-1.com/any_subdir/file.ext will 'not' redirect
to
http://www.domain-2.com/subdir
I've tried numerous ways, to no avail.
Any help would be greatly appreciated.
Thanks in advance.
-----
when HTTP_REQUEST {
set uri [HTTP::uri]
set host [HTTP:host]
if { [HTTP:host] contains "www.domain.com }
if { [HTTP:uri] not ends_with (matches_regex {\.\w+}) }
{
HTTP::redirect "HTTP://www.domain-2.com/$uri}}
-----
No RepliesBe the first to reply
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