Forum Discussion
siru_129409
Nimbostratus
Sep 21, 2015url rewriting/redirection
Hi all
I Have a query on URL rewriting/redirection, I have two scenarios as explained below
Scenario 1
users type www.abc.com on browser and We have hosted the site internally as www.xyz.c...
Sep 22, 2015
Hi!
Giving this a go:
If you want to host site www.xyz.com as www.abc.com you can replace the host header on the way in and use a stream profile to replace links with xyz.com with abc.com:
when HTTP_REQUEST {
Disable the stream filter for requests
STREAM::disable
Remove this header to prevent server from compression response
HTTP::header remove Accept-Encoding
Replace the host header to match www.xyz.com
HTTP::header replace "Host" "www.xyz.com"
}
when HTTP_RESPONSE {
Rewrite the Location header for redirects
if { [HTTP::header exists Location] }{
HTTP::header replace Location [string map {"https://www.xyz.com" "https://www.abc.com"} [HTTP::header Location]]
}
Rewrite the response content using a stream profile if it is text
if { [HTTP::header Content-Type] contains "text" } {
Set the stream expression with the find/replace strings
STREAM::expression "@www.xyz.com@www.abc.com@"
Enable the stream filter
STREAM::enable
}
}
Scenario 2:
Haven't worked with arabic at all, but I think you can use IDN formatting to achieve that.
Check out this site: http://mct.verisign-grs.com/convertServlet?input=www.%D8%A7%D8%AE%D8%AA%D8%A8%D8%A7%D8%B1
/Patrik
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