Foren
Login redirection problem with Apache and Tomcat
Daniel Butts, geändert vor 12 Jahren.
Login redirection problem with Apache and Tomcat
New Member Beitrag: 1 Beitrittsdatum: 03.01.12 Neueste Beiträge
We are using apache and mod_jk to redirect requests on port 80 to Tomcat on port 8080. In order to ensure security, my portlet checks that there is an authenticated user and if there is not, it redirects to the login page. Here is the code that I use in the jsp of my portlet:
<%
if (request.getRemoteUser() == null) {
%>
<script type="text/javascript">
location.replace('/c/portal/login');
</script>
<%
} else {
%>
This redirects to the login page fine and when on the local machine, authentication works normally. However when browsing to Liferay from the Internet (http://myserver.mydomain.com/web/guest/home) the form target of the login page and the URL of the "Return to Full Page" link are http://localhost:8080/web/guest/home.
Liferay appears to be using the absolute url of where it is hosted in Tomcat rather than a relative url. Where have we gone wrong?
Thanks
<%
if (request.getRemoteUser() == null) {
%>
<script type="text/javascript">
location.replace('/c/portal/login');
</script>
<%
} else {
%>
This redirects to the login page fine and when on the local machine, authentication works normally. However when browsing to Liferay from the Internet (http://myserver.mydomain.com/web/guest/home) the form target of the login page and the URL of the "Return to Full Page" link are http://localhost:8080/web/guest/home.
Liferay appears to be using the absolute url of where it is hosted in Tomcat rather than a relative url. Where have we gone wrong?
Thanks
Ravi Kumar Gupta, geändert vor 12 Jahren.
RE: Login redirection problem with Apache and Tomcat
Liferay Legend Beiträge: 1302 Beitrittsdatum: 24.06.09 Neueste Beiträge
I faced this problem.. See this post http://www.liferay.com/community/forums/-/message_boards/message/6895116
Let me know if this solves your problem..
Let me know if this solves your problem..