Comment By: Johan Compagner (joco01)
Date: 2005-07-15 13:29
Message:
Logged In: YES user_id=379231
but if a crawler or what ever really sees it as a perminant
link and is going to use that from that day on. Then it goes
wrong. Because the first time you MUST hit / you can't do directly
/path=0 (then you will get a page
expired message)
If you really want a bookmarkable page then you should link that
home page is mapped to the right url that it also is if you
did go to that same page through any other means (by a
submit or by a link)
That is unified now.
Just look at:
http://www.wicket-library.com/wicket-examples/forminput
Which still uses the old version
if you go to:
http://www.wicket-library.com/wicket-examples/forminput
you see that the url stays that way.
But if you then press save, the url changes to:
http://www.wicket-library.com/wicket-examples/forminput?component=2&version=0&interface=IRedirectListener
(or something like that)
So now you can go back in the browser ect, because the
browser sees it as a new page. But it is the same one.
With the new code if you go to:
http://www.wicket-library.com/wicket-examples/forminput
you will get directly:
http://www.wicket-library.com/wicket-examples/forminput?path=0
and if you press save you still have:
http://www.wicket-library.com/wicket-examples/forminput?path=0
so the url is stable.
The jsessionid is not what we as wicket append to the url.
It is what the webcontainer does for you if you give it a
redirect url.
(maybe not if you do that redirect yourself and set the url
yourself)
I think we need to introduce some kind of HomePage options:
1> don't redirect, just render homepage at once (url stays /)
2> redirect before render (url becomes /path=0)
3> make it a bookmarkable page (url becomes
/bookmarkablePage=" + getClass().getName())
And then with 3 you want a 301 with 2 a 307
----------------------------------------------------------------------
Comment By: Gili Tzabari (cowwoc)
Date: 2005-07-15 13:07
Message:
Logged In: YES user_id=80628
I think you better read
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2
Permanent redirect doesn't mean that clients can't continue
to hit the original URL, but it states they SHOULD not do
so. I suggest you read the full description in the above URL
as it explains it better than me. Take a look at HTTP 301
versus HTTP 307.
As far as I can tell, we should definately be issueing a
HTTP 301 here.
Also, I just tried CVS head. Can you please explain to me
why my bookmarkable Page now contains a jsessionid and path
argument?
For example, I now see this URL:
http://www.desktopbeautifier.com/Main;jsessionid=4DFF88C0742C617D27F84B716DBAB182?path=0
Bookmarkable pages shouldn't have a jsessionid. It causes
crawlers not to index them, for one.
----------------------------------------------------------------------
Comment By: Johan Compagner (joco01)
Date: 2005-07-15 07:20
Message:
Logged In: YES user_id=379231
they are all clientside redirects.. It is just a matter how the
browser it sees from that on.
But a user will always type:
/myapp
again and then again be redirected to what the homepage
page/component is:
/myapp?path=0
probely, but it shoudn't directly the first time hit that
redirect url!!
So it is not really a permantent redirect. But a temp one.
Because the next time he should hit / again not ?pag=0
----------------------------------------------------------------------
Comment By: Gili Tzabari (cowwoc)
Date: 2005-07-15 02:33
Message:
Logged In: YES user_id=80628
What is gained by a client-side redirect? To me, this is a
clear case of a permanent redirect. We are saying: "the URL
is not X, it is Y. Please don't try hitting X again".
Client-side redirects will lead to extra server overhead
(and people keep on hitting X) with no benefit that I can see.
----------------------------------------------------------------------
Comment By: Johan Compagner (joco01)
Date: 2005-07-14 22:01
Message:
Logged In: YES user_id=379231
and that should be done by setting the header/response code
youreself i believe:
res.setHeader("Location", "url" );
res.setStatus(301);
Maybe we should build in wicket that option that you can
choose between those 2 redirects.
----------------------------------------------------------------------
Comment By: Gili Tzabari (cowwoc)
Date: 2005-07-14 21:47
Message:
Logged In: YES user_id=80628
We should be issuing a HTTP 301, not HTTP 307 or client-side
redirect.
----------------------------------------------------------------------
Comment By: Johan Compagner (joco01)
Date: 2005-07-14 21:35
Message:
Logged In: YES user_id=379231
it is a client side redirect. So the url changes and stays
that way.
What kind of client side redirect are there ?
For now i am closing this bug a homepage call like:
/forminput
will be come
/forminput?path=0
If this doesn't fit some needs then please make a bug
describing that case.
----------------------------------------------------------------------
Comment By: Gili Tzabari (cowwoc)
Date: 2005-07-14 20:36
Message:
Logged In: YES user_id=80628
Hmm, please ensure this is a permanent redirect, not a
normal redirect() call which maps to temporary redirect.
Reason being that we want to indicate to Google to not index
the original URL and rather index to the URL we redirect to.
----------------------------------------------------------------------
Comment By: Johan Compagner (joco01)
Date: 2005-07-14 19:26
Message:
Logged In: YES user_id=379231
the homepage does do a redirect now. (1.1)
So that it does have the exact same adress as if you link or
do a submit to it. The url is now stable if you for example
look at the forminput example (homepage url is the same as
the url after the submit)
don't know what i find more appealing. I am more into stable
urls if you do something from youre homepage.
----------------------------------------------------------------------
Comment By: Gili Tzabari (cowwoc)
Date: 2005-06-30 17:39
Message:
Logged In: YES user_id=80628
Another problem with the homepage having two different URLs
but identical content is that Google sees this and lowers
your site PageRank because they count this as "URL spam". As
if you're trying to artificially increase your PageRank by
adding new, but fake, pages.
----------------------------------------------------------------------
Comment By: Gili Tzabari (cowwoc)
Date: 2005-06-13 05:48
Message:
Logged In: YES user_id=80628
Here is my proposed patch:
/**
* Ensures that the homepage gets a canonical URL.
*/
private void ensureCanonicalURL()
{
StringBuilder path = new
StringBuilder(getRequest().getURL().trim());
boolean redirect = false;
if (path.toString().endsWith("/"))
{
// If url hit is http://hostname/page/, redirect to
http://hostname/page
path.deleteCharAt(path.length()-1);
redirect = true;
}
if (getRequest().getParameter("bookmarkablePage")==null)
{
// Ensure URL always contains bookmarkablePage so
BookmarkableLinks to
// this page will show up as visited
if (path.indexOf("?")==-1)
path.append('?');
else
path.append('&');
path.append("bookmarkablePage=" + getClass().getName());
redirect = true;
}
if (redirect)
getResponse().redirect(path.toString());
}
simply execute this at the top of the homepage and it
ensures a canonical URL.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=684975&aid=1219477&group_id=119783