Fórumok
[Resolved] Problem with documents' url & Virtual host
Jerome Cance, módosítva 10 év-val korábban
[Resolved] Problem with documents' url & Virtual host
New Member Bejegyzések: 2 Csatlakozás dátuma: 2014.02.04. Legújabb bejegyzések
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
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
Tejas Kanani, módosítva 10 év-val korábban
RE: Problem with documents' url & Virtual host
Liferay Master Bejegyzések: 654 Csatlakozás dátuma: 2009.01.06. Legújabb bejegyzések
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
with
Best Regards,
Tejas Kanani
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, módosítva 10 év-val korábban