michel wrote:
...
André, I am not sure that I understand but I think that I do. In this
case, I believe that HTML does interpret links in a natural way.
Normally, the HTML picks up the base href from the toolbar. In the case
of a forward with a clean URL in the toolbar, we already have an
unnatural HTML process going on. But I am only using the base href on
that single page anyway.
I will take your last phrase above first.
If that is true, and if it remains that way, then it is not a big problem.
But if you find yourself in a situation where you start having to use the "base href"
mechanism in more pages, then stop and rethink the whole thing before you do that.
Because it is the kind of thing where you start by putting your little finger, and before
you know it, your whole arm will be sucked into it also.
Now about the rest.
The browser does not really look at the toolbar or the URL input box.
The browser gets a page from a server, and it interprets that page.
When it does that, the browser knows one thing : from which absolute URL it received the
current page. That is its starting point to interpret the links that are contained in the
page.
In other words, *the URL from which it received the current page* is its "natural
base href".
But when inside that page, you use the <base href=...> directive, then you force the
browser to ignore where-from it has received the current page, and to use this new "base
href" instead.
That is a very blunt instrument, because it influences the way in which the browser is now
going to interpret all the relative links inside the page.
So it is like a big hammer to hit a small nail, and you should be very careful
with it.
For example, if you give a copy of all your website pages to a website graphic designer,
to improve the look, then it means that this graphic designer will not be able to easily
"simulate" your website on his own computer, just because all the links will be
interpreted wrongly (they will keep linking to your original website, instead of his copy).
For example also, it means that if one day you decide that your clients have to go through
a proxy server to access some of your pages, you may have problems because browsers will
try, for some links, to keep accessing the original server directly.
You get the idea.
What I mean in general, is that fixing your problem using a "base href" may be a quick
solution in this particular case, but it is probably not the "right" solution in general,
and may cause you more problems later on. The right solution would be to make sure that
all the relative links in your pages, when they are interpreted by the browser and
requested from the server, are also being caught by the rewriting mechanism on the server,
and properly redirected to where they should.
And preferably, that this would happen internally on the server, without sending a
redirect response to the browser and forcing the browser to make a second request for
everything.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org