Foros de discusión

[Resolved] Problem with documents' url & Virtual host

Jerome Cance, modificado hace 10 años.

[Resolved] Problem with documents' url & Virtual host

New Member Mensajes: 2 Fecha de incorporación: 4/02/14 Mensajes recientes
Hi

We have a problem with links for download documents after adding a virtual host with Liferay 6.2 CE GA1.

We have created an organisation and a site attached. For this site, we have added a virtual host ("intranet") for private pages.
We have created a private page "Documents" with "Document & Media" portlet.

For access to this page, we can use
- default url : http://localhost:8080/group/my_orga/documents/
- url with virtual host : http://intranet:8080/documents/

These two urls work well.

With default url, the download link (http://localhost:8080/documents/x/y/test.doc/...) works.
But if we access from virtual host, the download link (http://intranet:8080/documents/x/y/test.doc/...) doesn't work and we get a 404 result.

How we can fix this problem ?

Thanks by advance

Regards
thumbnail
Tejas Kanani, modificado hace 10 años.

RE: Problem with documents' url & Virtual host

Liferay Master Mensajes: 654 Fecha de incorporación: 6/01/09 Mensajes recientes
Verified and also getting the same issue.
Jerome, Did you create an issue in Liferay JIRA for the same ? If not, You can create one so that it can be fixed in upcoming release.

Possible Workaround
After making below changes and update the class in portal-impl.jar(Just for verification, otherwise we must not modify portal-impl.jar directly) I am able to make it work with private page virtual host as well. Not sure if this the best fix for this issue. Sharing this for reference.

In com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter at line 289
https://github.com/liferay/liferay-portal/blob/6.2.x/portal-impl/src/com/liferay/portal/servlet/filters/virtualhost/VirtualHostFilter.java#L289

If I change below else condition
else {
	forwardURL.append(_PRIVATE_GROUP_SERVLET_MAPPING);
}

with
else {
	if (isDocumentFriendlyURL(
		request, group.getGroupId(), friendlyURL)) {

		processFilter(
			VirtualHostFilter.class, request, response,
			filterChain);

		return;
	}
	else {
		forwardURL.append(_PRIVATE_GROUP_SERVLET_MAPPING);
	}
}
.

Best Regards,
Tejas Kanani
Jerome Cance, modificado hace 10 años.

RE: Problem with documents' url & Virtual host

New Member Mensajes: 2 Fecha de incorporación: 4/02/14 Mensajes recientes
Thanks for this solution. It's worked.

I update also issue on Jira (LPS-44114)