Re: external links in a plone site redirect to the site itself

Phillip Abramson <[email protected]>
Newsgroups gmane.comp.web.zope.plone.user
Message-ID <022B41705C3CA640AE18DBF3E7105EF3688A514B@MEL-LEI-EXC-MBX.oxfam.org.au>

From: Phillip Abramson
Sent: Wednesday, 16 July 2014 10:50 AM
To: '[email protected]'
Subject: Re: [Plone-Users] external links in a plone site redirect to the site itself

Phillip Abramson <phillipa@...> writes:
> ...
>> Would this be an issue with the rule I've set for IIS to redirect to the site, with how links are managed in Plone 4.3 or something else?
>
[dm]
> You must tell us a bit more:
>
>   * How do the urls look like that arrive at IIS?
>   * How do the urls look like that arrive at Zope
>   * How to the external urls in your link objects look like, which
>     are wrongly derefenced? How does the wrong result look like?
>

[P]
> I can definitely tell you that for say a link to google, the final url appears like this:
> [URLofPlaceLinkWasClickedOn]/www.google.com

[dm]

It would look like this when the original url where considered
"relative" (as the browser would prepend the base url).

To find out whether the "[URLofPlaceLinkWasClickedOn]" prefix
was provided by Plone or the browser, you could look
at the pages source code (browsers usually provide a means
to get at the (HTML) page source). If you see there
a relative url (one not starting with a protocol), then the browser
has provided the prefix - otherwise, it has been Plone.

[P]
In the page source, it actually has the link as http:\\[hostname]\[wherelinkshouldgo]

[dm]


But, it may not be relevant who (browser or Plone) has provided
the prefix. The likely problem is in your external links - they
likely use faulty urls.

According to RFC 2396 (the Uniform Resource Identifier (uri) standard;
urls are some form of uris, thus covered also by this standard),
there are three types of uris/urls:

  *  absolute (they begin with "<protocol>::")
  *  host relative (they begin with "/")
  *  and relative

Relative uris/urls are resolved with respect to the base uri/url
(this means "[URLofPlaceLinkWasClickedOn]" in your case),
host relative uris/urls are resolved with respect to the
host from which the page was obtained (this means "[YourHost]" in your case).

>From this description, you can see that (standard conform)
"external" uri/urls must start with "<protocol>::".


Thus, making the urls in your link objects (and elsewhere) standard conformant
will (almost surely) solve the problem.

[P]
That does definitely solve the issue, but it has to be done manually; I can definitely enforce the users putting in links correctly now, since TinyMCE makes you pick a protocol, as for the others, I've got the redirect rule as a temporary fix until he various external links are all updated

Thanks for the help

Cheers,
Phillip

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds

_______________________________________________
Plone-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plone-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.