You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Parag <pa...@mac.com> on 2016/04/28 01:15:07 UTC

Wicket Redirects and Facebook

Hi All,

I have a problem which has me baffled.  I am sure it is something minor but I just can’t figure it out, so I figured I would post to this group in the hope that someone knows how I could fix this problem which I never thought I had :)  So here goes:

We have a wicket based project under development and the problem we have with wicket redirects…. this is making it impossible for us to share our pages on facebook (and probably other social media site).   The problem seems to be that wicket is redirecting slug based incoming requests. Because of this the facebook crawler (or scrapper) is not able to see our page and so returns an error.  

So the slug based user friendly URL is :
http://example.com/webapp/poll/who-is-the-most-important-person-in-the-country-in-2014-T196
It causes a redirection to:- 
http://example.com/mysite-webapp/wicket/page?1

So when I post this URL to Facebook  it shows "Page Not Found" But if you click on the link it it works. 
My question is why Wicket is redirecting it to "example.com/mysite-webapp/wicket/page?1". It doesn't happen for non-slug based URL.

In the Wicket app I have defined the URL as:
mount(new MountedMapperWithoutPageComponentInfo("tapMap/${tapcastName}-T${tapCastId}", TapMapPage.class));

Any help would be greatly appreciated.

Thanks
Parag


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket Redirects and Facebook

Posted by Martin Grigorov <ma...@gmail.com>.
Hi,

On Apr 28, 2016 6:05 AM, "Parag" <pa...@mac.com> wrote:
>
> Hi All,
>
> I have a problem which has me baffled.  I am sure it is something minor
but I just can’t figure it out, so I figured I would post to this group in
the hope that someone knows how I could fix this problem which I never
thought I had :)  So here goes:
>
> We have a wicket based project under development and the problem we have
with wicket redirects…. this is making it impossible for us to share our
pages on facebook (and probably other social media site).   The problem
seems to be that wicket is redirecting slug based incoming requests.
Because of this the facebook crawler (or scrapper) is not able to see our
page and so returns an error.
>
> So the slug based user friendly URL is :
>
http://example.com/webapp/poll/who-is-the-most-important-person-in-the-country-in-2014-T196
> It causes a redirection to:-
> http://example.com/mysite-webapp/wicket/page?1
>
> So when I post this URL to Facebook  it shows "Page Not Found" But if you
click on the link it it works.

Sorry. It is not very clear whether the url works when typed/pasted in the
browser. Does it redirect always or only when coming from Facebook?

> My question is why Wicket is redirecting it to "
example.com/mysite-webapp/wicket/page?1". It doesn't happen for non-slug
based URL.

Wicket will produce "wicket/page?pageId" only for pages instantiated  via
custom contructor, i.e. neither non-arg contructor nor the one with
PageParameters as a single argument.

>
> In the Wicket app I have defined the URL as:
> mount(new
MountedMapperWithoutPageComponentInfo("tapMap/${tapcastName}-T${tapCastId}",
TapMapPage.class));

I don't see "tapMap/" in the urls above.
Make sure the mounted page is the one that should handle such urls.

>
> Any help would be greatly appreciated.
>
> Thanks
> Parag
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>