Forum Discussion
how to publish wordpress subsite from root / - URI Masking
So if I understand your question, your app is accessible with the /wordpress URI prefix, but you want it externally accessible as simple "/". In order to make this work you have to do a few things:
-
You have to make sure that all response content (HTTP headers and payload) with this URI are mapped from /wordpress to /
-
You have to rewrite the URI prefix from / to /wordpress[HTTP::uri] on each incoming request.
So let's take a look at what that iRule might look like:
when HTTP_REQUEST {
don't let the server compress responses
HTTP::header remove Accept-Encoding
disable STREAM for requests
STREAM::disable
rewrite URI if it doesn't start with /test
if { not ( [string tolower [HTTP::uri]] starts_with "/wordpress" ) } {
HTTP::uri "/wordpress[HTTP::uri]"
}
}
when HTTP_RESPONSE {
catch and replace redirect location headers
if { [HTTP::header exists Location] } {
HTTP::header replace Location [string map -nocase {"/wordpress" "/"} [HTTP::header Location]]
}
enable STREAM to replace payload URI content
STREAM::expression {@/wordpress@@}
STREAM::enable
}
This is a simple example, so you may have to tweak a little to get it just right, but hopefully it makes sense. You can also accomplish most/all of this with URI-translation rewrite profile if you're running a newer version of BIG-IP.
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