Forum Discussion
Redirecting URL with #
"" is a reserved character denoting a "fragment identifier component", the processing of which is a client-side operation. See rfc3986.
In the case you have described,
...//fqdn/myaccount//forms/moving
works when the primary resource, i.e. the default index page in the directory "/myaccount", which can be "index.html" depending on the configuration of your Web server, is available, which accounts for the two success situations you have described above.
...//fqdn/myaccount/forms/moving
fails because there is no primary content page in the directory "/myaccount/forms/moving" on your Web server.
Based on the information you have provided, a redirect from:
...//fqdn/myaccount//forms/moving
to:
...//fqdn/moving
can be achieved by setting up an HTTP header in the server response to any request for a resource in the directory "/myaccount" at your Web server:
Location: /moving/
. BTW, the browser should also append the original fragment identifier automatically if that's also what you want. See s7.1.2 of rfc7231.
If you want to utilize irules, here's a simple one:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/myaccount"} {
HTTP::respond 301 Location "/moving/"
}
}
.
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