Forum Discussion
Can you clarify the requirements a bit? What you're looking for is certainly doable, but I'm unclear on the precise syntax. Are you saying that all content on the OWS (Origin Web Server) is will be under a root called "toplevel" but that you don't want the user to see that in the URL? If so, what part of the path would indicate which project they're accessing?
Also, it looks like you're assigning a new value to HTTP::uri before using it in the redirect. However, although HTTP::uri can be read, it has a double function in that changing the value is intended to alter the value that's being sent to the OWS. You'll want to either use a variable or use the statement itself in the redirect. The latter would be preferred as it is more efficient.
Lastly, using HTTP::redirect is inefficient as it uses a 302 (temporary redirect) rather than a 301 (permanent redirect). If the redirect for a given URL will always be the same you'll want to use a 301. To accomplish this you need to use
HTTP::respond
rather than HTTP::redirect
.
Having said all that, should it really be a redirect or would it be better to make it transparent to the user? (i.e. route the request to the appropriate resource on the OWS but keep the URL in the browser the same)