Forum Discussion
Ramprasath_K_19
Nimbostratus
Jan 26, 2016Redirction from https://abc.com to https://abc.com/xyz/
Hi kindly help me to fix the below requirement
I would like to redirect the site From https://abc.com to https://abc.com/xyz/ ( to a sub site)
I am using cookie persistence.
Thanks and Regards, Ram
1 Reply
Hi Ram,
you may take a look to the two example below.
Example1: Redirect just "/" (aka. Website ROOT) to /xyz/
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "abc.com" } then { if { [string tolower [HTTP::uri]] equals "/" } then { Redirect just "/" (aka. Website ROOT) to /xyz/ HTTP::redirect "https://abc.com/xyz/" } else { You may want to implement additional code to handle request to other URIs. } } else { You may want to implement additional code to handle request to other HOST-names. } }Example2: Redirect everthing which is not /xyz to /xyz/
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "abc.com" } then { if { [string tolower [HTTP::uri]] starts_with "/xyz" } then { You may want to implement additional code to handle /xyz requests. } else { Redirect everthing which is not /xyz to /xyz/ HTTP::redirect "https://abc.com/xyz/" } } else { You may want to implement additional code to handle request to other HOST-names. } }Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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