Forum Moderators: phranque
My question is:
when user request a url like:
example.com/keyword
I redirect his request to my real html file
example.com/keyword/keyword1.htm,
But I wish the address bar is still showing his url request. in another world, keep short url,
so easy to remember.
One similar application like:
http://example.com/tag/web
very neat url to remember.
anyway, any guru know an answer to this?
thanks so much!
[edited by: jdMorgan at 5:48 am (utc) on June 18, 2005]
[edit reason] Example.com [/edit]
Welcome to WebmasterWorld!
The technically-correct answer to your question is "No, it is not possible to do a redirect and keep the original URL in the address bar." This is because a redirect, by definition, involves telling the browser to ask for the requested resource at a different URL. So the browser updates its address bar and uses the new URL.
However, there are two ways to avoid the URL update. The simplest can be used if the content is on the same server: Use a rewrite, not a redirect. An internal rewrite simply serves content from a local file-path that is different from the requested local URL-path.
The second method must be used if the content is on a different server. This involves setting up the first server as a proxy for another server. All incoming requests then pass through the first server, and content is returned from the second server, back through the first, and on to the requesting client.
I suspect that all you need to do is to use the rewrite method, as this is most common.
Jim