Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Joel Goguen
Portal redirects to last viewed page when viewing root URL
7 de Janeiro de 2011 06:25
Resposta

Joel Goguen

Ranking: New Member

Mensagens: 10

Data de entrada: 1 de Novembro de 2010

Mensagens recentes

I'm having trouble finding any information about redirecting users from the base URL. I have a Liferay 5.2 installation and I'm finding that if I view a public page as an unauthenticated user, then to to the base URL I'm automatically redirected to the last page I viewed. So say I view https://portal.domain/web/jgoguen/profile and then try to visit https://portal.domain/, I would be automatically redirected to https://portal.domain/web/jgoguen/profile again.

I can't seem to find anything relevant about this. Basically, I want all requests for the root URL to redirect to the login screen, and the portal can either display the login screen if they're unauthenticated or forward them if they're already authenticated. Pointers to documents I've missed or properties to investigate further would be greatly appreciated.
Jonas Yuan
RE: Portal redirects to last viewed page when viewing root URL
7 de Janeiro de 2011 06:40
Resposta

Jonas Yuan

Ranking: Liferay Master

Mensagens: 993

Data de entrada: 26 de Abril de 2007

Mensagens recentes

Hi Joel,

It should work as you expected.

Which Liferay version are you using? 5.2.3 CE or 6.0.5 CE?

Thanks

Jonas Yuan
==================
The Author of Liferay Books:
Liferay User Interface Development
Liferay Portal 6 Enterprise Intranets
Liferay Portal 5.2 Systems Development
Liferay Portal Enterprise Intranets
Joel Goguen
RE: Portal redirects to last viewed page when viewing root URL
7 de Janeiro de 2011 06:40
Resposta

Joel Goguen

Ranking: New Member

Mensagens: 10

Data de entrada: 1 de Novembro de 2010

Mensagens recentes

I'm using 5.2.3 with Tomcat 6.
Minhchau Dang
RE: Portal redirects to last viewed page when viewing root URL
7 de Janeiro de 2011 07:47
Resposta

Minhchau Dang

LIFERAY STAFF

Ranking: Expert

Mensagens: 349

Data de entrada: 22 de Outubro de 2007

Mensagens recentes

Joel Goguen:
I want all requests for the root URL to redirect to the login screen, and the portal can either display the login screen if they're unauthenticated or forward them if they're already authenticated.

If I understand what you're saying correctly, you want Liferay to behave in this way only on requests for "/". Namely, if a user were to request "/c", which is what Liferay redirects to after you request "/" and which is ultimately what causes the behavior you see, they should still get the last path behavior even if they are not authenticated.

If that's the case, the logic for what happens when you request "/" is handled by index.jsp and the easiest way to achieve what you describe would be to modify that file (either in the ext-web folder in an EXT environment or via a Liferay custom JSP hook) to always redirect to your login page for an unauthenticated user.
Joel Goguen
RE: Portal redirects to last viewed page when viewing root URL
7 de Janeiro de 2011 07:49
Resposta

Joel Goguen

Ranking: New Member

Mensagens: 10

Data de entrada: 1 de Novembro de 2010

Mensagens recentes

Thanks for the info, I was expecting a property of some sort. I'll take a look around index.jsp and see what I can do.
Joel Goguen
RE: Portal redirects to last viewed page when viewing root URL
14 de Janeiro de 2011 08:38
Resposta

Joel Goguen

Ranking: New Member

Mensagens: 10

Data de entrada: 1 de Novembro de 2010

Mensagens recentes

Thanks again for your help. I was able to edit ROOT/index.jsp to always redirect to our custom login page, which I chose to do by setting the value in the 'redirect' variable and commenting out the LayoutSet logic, and it works great.
Fuad Efendi
RE: Portal redirects to last viewed page when viewing root URL
17 de Março de 2013 14:50
Resposta

Fuad Efendi

Ranking: Regular Member

Mensagens: 148

Data de entrada: 5 de Abril de 2007

Mensagens recentes

Joel Goguen:
I'm having trouble finding any information about redirecting users from the base URL. I have a Liferay 5.2 installation and I'm finding that if I view a public page as an unauthenticated user, then to to the base URL I'm automatically redirected to the last page I viewed. So say I view https://portal.domain/web/jgoguen/profile and then try to visit https://portal.domain/, I would be automatically redirected to https://portal.domain/web/jgoguen/profile again.

I can't seem to find anything relevant about this. Basically, I want all requests for the root URL to redirect to the login screen, and the portal can either display the login screen if they're unauthenticated or forward them if they're already authenticated. Pointers to documents I've missed or properties to investigate further would be greatly appreciated.



I had similar problem after migrating to Liferay 6.1.1-patched from GitHub, the problem which I never had during 7 years; after several hour of experimenting I found the fix for my www.tokenizer.ca (main portal site):

company.default.home.url=/web/www.tokenizer.ca


Thanks