<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Page redirection on error</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=675760" />
  <subtitle>Page redirection on error</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=675760</id>
  <updated>2026-04-04T15:48:15Z</updated>
  <dc:date>2026-04-04T15:48:15Z</dc:date>
  <entry>
    <title>RE: Page redirection on error (404)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11930201" />
    <author>
      <name>Jelmer Kuperus</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11930201</id>
    <updated>2011-12-30T14:36:03Z</updated>
    <published>2011-12-30T14:36:03Z</published>
    <summary type="html">I did this : http://www.liferay.com/community/forums/-/message_boards/message/11279721</summary>
    <dc:creator>Jelmer Kuperus</dc:creator>
    <dc:date>2011-12-30T14:36:03Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error (404)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11930188" />
    <author>
      <name>Roshan Qureshi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=11930188</id>
    <updated>2011-12-30T14:22:47Z</updated>
    <published>2011-12-30T14:22:47Z</published>
    <summary type="html">Thanks Drew. Good solution. We can override status.jsp if we want this to work for all status code</summary>
    <dc:creator>Roshan Qureshi</dc:creator>
    <dc:date>2011-12-30T14:22:47Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error (404)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6405853" />
    <author>
      <name>Drew Poggemann</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6405853</id>
    <updated>2010-11-10T16:15:47Z</updated>
    <published>2010-11-10T16:15:47Z</published>
    <summary type="html">Hi everyone, I know this post is older but I thought I would add something I found because we needed to have community based 404 page so we did the following to accomplish this.&lt;br /&gt;&lt;br /&gt;1.  Currently the /errors/404.jsp page in the ROOT webapps is what is called. &lt;br /&gt;2.  I modified the web.xml to point to a new custom page that is exactly the same as the original but we did the following change to go to a defined friendly url of &amp;#34;/pagenotfound&amp;#34; that can be created as a page in each community.  &lt;br /&gt;3.  If the page does not exist in the community then it will do the following based on default liferay capabilities&lt;br /&gt;   a.  Go to the last page navigated in the community&lt;br /&gt;   b.  If first time going to site it will go to top page in community page hierarchy&lt;br /&gt;&lt;br /&gt;The new 404 page we created (and then pointed to in the web.xml) will have the same code as 404 page with minor changes as identified below to go to the pagenotfound page in the community.  &lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;LayoutSet layoutSet = (LayoutSet)request.getAttribute(WebKeys.VIRTUAL_HOST_LAYOUT_SET);&lt;br /&gt;&lt;br /&gt;if (layoutSet != null) {&lt;br /&gt;  if (&amp;#34;/pagenotfound&amp;#34;.equals(PortalUtil.getCurrentURL(request))) {&lt;br /&gt;    redirect = PortalUtil.getPathMain();&lt;br /&gt;  }&lt;br /&gt;  else {&lt;br /&gt;    // Redirect to page in the community if the page exists&lt;br /&gt;    redirect = &amp;#34;/pagenotfound&amp;#34;;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;        redirect = PortalUtil.getHomeURL(request);&lt;br /&gt;}&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;Hopefully this helps anyone that needed to do the same thing.  If there are better ways to do this that I missed, I would love your input.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;Drew</summary>
    <dc:creator>Drew Poggemann</dc:creator>
    <dc:date>2010-11-10T16:15:47Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error (404)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4278810" />
    <author>
      <name>Simon Prinzleve</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4278810</id>
    <updated>2009-11-15T20:00:14Z</updated>
    <published>2009-11-15T20:00:14Z</published>
    <summary type="html">Ah - finally got it. &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" &gt;&lt;br /&gt;&lt;br /&gt;The magic is in the /errors/404.jsp file (which is being pointed at by liferays web.xml file&lt;br /&gt;&lt;br /&gt;Detailed solutions is also describen in this &lt;a href="http://liferay-portlets.blogspot.com/2009/11/satisfy-google-create-404-error-message.html"&gt;blogpost about the 404 error with liferay&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks again!</summary>
    <dc:creator>Simon Prinzleve</dc:creator>
    <dc:date>2009-11-15T20:00:14Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error (404)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4278600" />
    <author>
      <name>Simon Prinzleve</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4278600</id>
    <updated>2009-11-15T16:57:54Z</updated>
    <published>2009-11-15T16:57:54Z</published>
    <summary type="html">Hey Chris,&lt;br /&gt;&lt;br /&gt;thanks a lot - that really helps.&lt;br /&gt;&lt;br /&gt;So for 1) I&amp;#39;m fine now.&lt;br /&gt;&lt;br /&gt;How about 2)&lt;br /&gt;I&amp;#39;m using the liferay-tomcat bundle - so this tomcat has been configured by liferay.&lt;br /&gt;&lt;br /&gt;Where can I adjust the standard behaviour to route everything to the default liferay guest URL? ( /web/guest if not reconfigured) &lt;br /&gt;&lt;br /&gt;I want just / to route to the standard guest url ( /web/guest )&lt;br /&gt;I want everything else (like /blabla ) to route to a error page with an 404&lt;br /&gt;&lt;br /&gt;I would do this with apache - but as I am using liferay for multiple virtual hosts (using multiple portal instances) this might be a bit tricky.&lt;br /&gt;&lt;br /&gt;Any ideas?</summary>
    <dc:creator>Simon Prinzleve</dc:creator>
    <dc:date>2009-11-15T16:57:54Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error (404)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4224176" />
    <author>
      <name>Chris Kauffman</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4224176</id>
    <updated>2009-11-03T21:35:49Z</updated>
    <published>2009-11-03T21:35:49Z</published>
    <summary type="html">I ran into this issue today as well.&lt;br /&gt;&lt;br /&gt;There are actually two problems here.&lt;br /&gt;1.  If the user mangles only the last part of the URL, then the setting in portal.properties (or more properly in portal-ext.properties) works fine.  For example,&lt;br /&gt;&lt;br /&gt;[indent]VALID URL:    http://localhost/group/cp/home[/indent]&lt;br /&gt;[indent]Invalid URL:   http://localhost/group/cp/badhome[/indent]&lt;br /&gt;&lt;br /&gt;The second url will get redirected to whatever value I set for layout.friendly.url.page.not.found=&lt;br /&gt;&lt;br /&gt;2. If the user mangles everything immediately after the domain, then liferay doesn&amp;#39;t handle it.  You app server does.  If you are running on Tomcat or JBoss or whatever, it has its own page not found functionality which you have to configure&lt;br /&gt;&lt;br /&gt;[indent]http://localhost/blahblahBADurl[/indent]</summary>
    <dc:creator>Chris Kauffman</dc:creator>
    <dc:date>2009-11-03T21:35:49Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error (404)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4027472" />
    <author>
      <name>Lisa Simpson</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4027472</id>
    <updated>2009-09-15T23:22:32Z</updated>
    <published>2009-09-15T23:22:32Z</published>
    <summary type="html">The thread is still valid... but there doesn&amp;#39;t seem to be a good answer yet.</summary>
    <dc:creator>Lisa Simpson</dc:creator>
    <dc:date>2009-09-15T23:22:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error (404)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4015562" />
    <author>
      <name>Anika Hofmann</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=4015562</id>
    <updated>2009-09-13T13:27:54Z</updated>
    <published>2009-09-13T13:27:54Z</published>
    <summary type="html">Hi Simon!&lt;br /&gt;&lt;br /&gt;It seems to me no-one is watching this old thread anymore. Maybe you just start a new post should be interesting for me too!&lt;br /&gt;&lt;br /&gt;Thanks, Anika</summary>
    <dc:creator>Anika Hofmann</dc:creator>
    <dc:date>2009-09-13T13:27:54Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error (404)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=3950189" />
    <author>
      <name>Simon Prinzleve</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=3950189</id>
    <updated>2009-09-03T21:54:44Z</updated>
    <published>2009-09-03T21:54:44Z</published>
    <summary type="html">Hello,&lt;br /&gt;&lt;br /&gt;I tried to do the same - these are my setting in portal-ext.properties:&lt;br /&gt;&lt;br /&gt;layout.show.http.status=true&lt;br /&gt;layout.friendly.url.page.not.found=/errors/404.jsp&lt;br /&gt;&lt;br /&gt;Note: I&amp;#39;m on 5.2.2. - and I discovered the jsp file &lt;strong&gt;/errors/404.jsp&lt;/strong&gt;&lt;br /&gt;But neither with the 404.jsp by liferay nor with an own error file I got it working.&lt;br /&gt;&lt;br /&gt;I&amp;#39;m still being redirected to /web/guest - regardles whether I&amp;#39;m signed in or not.&lt;br /&gt;&lt;br /&gt;Any additional advices? I&amp;#39;m going mad! &lt;br /&gt;(Especially as google hates a 200 status for a page not found..)&lt;br /&gt;&lt;br /&gt;Thank you so much!&lt;br /&gt;&lt;br /&gt;Simon&lt;br /&gt;&lt;br /&gt;--- update 6th Sept&lt;br /&gt;&lt;br /&gt;I did some additional tests &lt;br /&gt; - setting up a liferay page for the error message (/web/guest/error)&lt;br /&gt; - playing with similar parameters like  auth.forward.by.last.path=false&lt;br /&gt;&lt;br /&gt;all without success&lt;br /&gt;&lt;br /&gt;Maybe it has to something to do with the fact that I migrated from 4.3.5? (Over several stages)&lt;br /&gt;I have those legacy setting:&lt;br /&gt;&lt;br /&gt;resource.repositories.root=${user.home}/liferay&lt;br /&gt;&lt;br /&gt;theme.portlet.sharing.default=true&lt;br /&gt;&lt;br /&gt;organizations.country.required[regular]=true&lt;br /&gt;organizations.assignment.auto=true&lt;br /&gt;organizations.assignment.strict=false&lt;br /&gt;organizations.membership.strict=true&lt;br /&gt;permissions.user.check.algorithm=2&lt;br /&gt;&lt;br /&gt;layout.user.private.layouts.power.user.required=true&lt;br /&gt;&lt;br /&gt;I am a bit desperate by now... any idea?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;----&lt;br /&gt;&lt;a href="http://liferay-portlets.blogspot.com"&gt;Blog about liferay for the internet&lt;/a&gt;</summary>
    <dc:creator>Simon Prinzleve</dc:creator>
    <dc:date>2009-09-03T21:54:44Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=692315" />
    <author>
      <name>Pablo Mosquera Sáenz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=692315</id>
    <updated>2008-04-17T07:36:35Z</updated>
    <published>2008-04-17T07:36:35Z</published>
    <summary type="html">I tried with a friendly url like&lt;br /&gt;&lt;br /&gt;layout.friendly.url.page.not.found=/web/company/error404&lt;br /&gt;and its an error page in my portal&lt;br /&gt;&lt;br /&gt;layout.friendly.url.page.not.found=/html/portal/error404.jsp should work too&lt;br /&gt;&lt;br /&gt;I have another question. This is just one error page, but there for example another error page (error.jsp). I have a problem with this page and it is that when there is an error the error.jsp is displayed in the default liferay comunity and look and feel (perhaps it is bacause it is under common folder). I want to display this page within my theme, with my navigation bar, and with my look and feel. Any idea?</summary>
    <dc:creator>Pablo Mosquera Sáenz</dc:creator>
    <dc:date>2008-04-17T07:36:35Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=690760" />
    <author>
      <name>Luis Colorado</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=690760</id>
    <updated>2008-04-16T18:24:29Z</updated>
    <published>2008-04-16T18:24:29Z</published>
    <summary type="html">I added the following line to portal-ext.properties at ROOT/WEB-INF/classes:&lt;br /&gt;&lt;br /&gt;layout.show.http.status=true&lt;br /&gt;&lt;br /&gt;However, I still get the same behavior. If I use the following URL:&lt;br /&gt;&lt;br /&gt;http:localhost:8080/ljasdfljasdf&lt;br /&gt;&lt;br /&gt;I get redirected to my last valid page. &lt;br /&gt;&lt;br /&gt;Then, I tried the following line in portal-ext.properties instead:&lt;br /&gt;&lt;br /&gt;layout.friendly.url.page.not.found=/html/portal/404.html&lt;br /&gt;&lt;br /&gt;And I still got redirected to my last valid page.&lt;br /&gt;&lt;br /&gt;Finally, I tried both:&lt;br /&gt;&lt;br /&gt;layout.show.http.status=true&lt;br /&gt;layout.friendly.url.page.not.found=/html/portal/404.html&lt;br /&gt;&lt;br /&gt;But, again, I still got redirected to my last valid page.&lt;br /&gt;&lt;br /&gt;Apparently, my settings don&amp;#39;t make any difference. I checked, and these properties show up in the Admin portlet.&lt;br /&gt;&lt;br /&gt;So, what gives? What&amp;#39;s going on?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Any ideas?&lt;br /&gt;&lt;br /&gt;Thank you all,&lt;br /&gt;&lt;br /&gt;Luis</summary>
    <dc:creator>Luis Colorado</dc:creator>
    <dc:date>2008-04-16T18:24:29Z</dc:date>
  </entry>
  <entry>
    <title>RE: Page redirection on error</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=675915" />
    <author>
      <name>Arcko Duan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=675915</id>
    <updated>2008-04-11T08:35:00Z</updated>
    <published>2008-04-11T08:35:00Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;try&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;#
    # Redirect to this resource if the user requested a friendly URL that does
    # not exist. Leave it blank to display nothing.
    #
    # Note: For backward compatibility, this overrides the property
    # "layout.show.http.status" for the 404 status code.
    #
    #layout.friendly.url.page.not.found=/html/portal/404.html&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;in portal.properties.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Arcko Duan</dc:creator>
    <dc:date>2008-04-11T08:35:00Z</dc:date>
  </entry>
  <entry>
    <title>Page redirection on error</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=675759" />
    <author>
      <name>Luis Colorado</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=675759</id>
    <updated>2008-04-11T07:24:17Z</updated>
    <published>2008-04-11T07:24:17Z</published>
    <summary type="html">Hi!&lt;br /&gt;&lt;br /&gt;I just upgraded from 4.2 to 4.4, and I have noticed that whenever I enter an invalid URL, Liferay graciously redirects my page to the latest valid page. So if I enter:&lt;br /&gt;&lt;br /&gt;http://localhost:8080/ljasdflkjasflj&lt;br /&gt;&lt;br /&gt;It will redirects me automatically to my last valid page.&lt;br /&gt;&lt;br /&gt;This is a nice feature for the end users, but for me it&amp;#39;s very annoying. I just want to see the error messages! I want to know what went wrong! I&amp;#39;m having a lot of trouble to find out what&amp;#39;s wrong with my old portlets.&lt;br /&gt;&lt;br /&gt;It is possible to disable this behavior?&lt;br /&gt;&lt;br /&gt;Thank you all in advance!&lt;br /&gt;&lt;br /&gt;Luis</summary>
    <dc:creator>Luis Colorado</dc:creator>
    <dc:date>2008-04-11T07:24:17Z</dc:date>
  </entry>
</feed>
