Forum Discussion
Cindy_127211
Nimbostratus
Aug 16, 2006Rewriting URI on HTTP Response
Is it possible to 'rewrite' a URI when a response comes back from a server?
What we want to have happen is the following:
The user types in:
http://www.website1.com/dir1/...
Aug 16, 2006
Unfortunately what you are requesting cannot be done due to the HTTP protocol itself. If HTTP allowed for the URI to be returned as part of the response and the browser acknowledged that value then you would be all set. You could easily add this to a response header but the browser wouldn't know what to do with it. But, per the HTTP specs, the URI is only part of the HTTP Request and the browser displays the value of its last request.
Now, if there are embedded url's in the payload (the HTML content) then you could modify those by modifying the HTTP::payload data, but I think you are getting at just changing the address bar.
Sorry, I wish we could perform magic, but sometimes we are stuck with the limitations of the protocols...
Wait, one thing just came to me. If JavaScript enabled you to modify the address field in the browser, then you could return a response header with the uri value you want to present, and then have some client side code change the address. But, I'm not aware of if this is possible. The closest thing I can think of is the "document.location.href" value but I don't know if this actually changes the address bar or not. Something to try at least...
-Joe
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
