掲示板

[Resolved] Problem with documents' url & Virtual host

10年前 に Jerome Cance によって更新されました。

[Resolved] Problem with documents' url & Virtual host

New Member 投稿: 2 参加年月日: 14/02/04 最新の投稿
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
10年前 に Tejas Kanani によって更新されました。

RE: Problem with documents' url & Virtual host

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
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
10年前 に Jerome Cance によって更新されました。

RE: Problem with documents' url & Virtual host

New Member 投稿: 2 参加年月日: 14/02/04 最新の投稿
Thanks for this solution. It's worked.

I update also issue on Jira (LPS-44114)