How to set a custom 410 page on liferay - liferay

I want to set a custom 410 page on liferay. I have already configured that for a 404 page via the file portal-ext.properties
layout.friendly.url.page.not.found=/html/portal/404.html
But I don’t know how to do it for a 410 page.
Thanks for helping

There is no such configuration option. If you look at the code of PortalImpl.sendError you will see, that there is a special test for NoSuchLayoutException. All other errors are just redirected to the status page.
You could either create an EXT plugin and overwrite PortalImpl.sendError to do whatever you want. Or you create a hook and overwrite /html/portal/status.jsp.

Related

Can a hard-set a status code in the web.config?

I would like to return a 404 status code for every single request to a website. I still want to deliver a page of content, but I want the status code on every single request to be 404. (It's weird, I know, but there's a specific reason...)
I know I could do with this an HTTP Module or an OWIN pipeline, but I'd like to do it without writing or deploying code, if possible. However, this is a very weird situation, so I'm not sure if this is possible.
Can I set this from the web.config?
As lex says, we couldn't return the right content page with 404 error status.
Here is a workaround, we could try to use custom error page to achieve your requirement. If it should return 404 error, you could redirect the page to custom error page. But you should use the url rewrite to redirect all the pages to a not existed page.
Details about how to use custom error page in IIS, you could refer to this article.
Details about how to use url rewrite, you could refer to this article.

Redirect URL is not allowed: Liferay Page Delete

When I go to Liferay 6.2 page management, and I delete a page from there the page is deleted from db but I get a error that "Dockbar is temporarily unavailable".
Also the logs says:
Redirect URL ....controlPanelCategory=current_site.pages is not allowed
ERROR [http-bio-8080-exec-26][render_portlet_jsp:132] null
com.liferay.portal.NoSuchLayoutException: No Layout exists with the primary key
Adding redirect.url.security.mode=domain to my portal-ext.properties worked and fixed this problem.
We had a similar issue. Some links were missing/not working when we went to the webcontent edit page.
We already had the redirect.url.security.mode=domain, but adding all the URLs to domain allowed solved the issue:
redirect.url.domains.allowed=t1.url.com,t2.url.com (Liferay 6.2.)
In Liferay 7 wildcards should work redirect.url.domains.allowed=*.url.com according to https://docs.liferay.com/portal/7.0/propertiesdoc/portal.properties.html

how can I show a 404 page for URL I don't want to have?

I have a website: http://www.immvestwolf.de/
For most websites a 404 page is shown for unknown pages like http://www.immvestwolf.de/ggggggg.
But there is one Section of the website which is build by a plugin. For that section, URLs which don't exist, do not give a 404 header status back.
For example: http://www.immvestwolf.de/expose/39/gggg. All URLs with "/expose/sometext" don't give a 404 header status back. How can I fix this problem?
Any path that hits the plugin is at the descretion of that plugin.So if ../expose ist the plugin, it is the responsibility of that plugin to decide whether a certain path (within the namespace controlled by the plugin) exists or not.
If the plugin does not care, then you might configure your web server to deny the to-be-non-existant sub-paths. E.g you may have your plugin handle /expose but reject any access to /expose/ or below.
How this is to be achieved depends on what web server you are using and how the plugin expects to be configured.

How can I configure IIS to use customerrors with option set to recreate for all extensions/MIMEs?

I'm currently using customErrors, and I would like to use the recreate option, always.
This currently works for URLs such as
mysite.com/asdf
My custom error page loads as this URL:
mysite.com/asdf
However, this is not working for URLs such as
mysite.com/asdf.aspx
My custom error page loads as
mysite.com/mycustomerrorpage.aspx?errorpath=/asdf.aspx
This is handled by IIS as a 302 redirect to the error page above with a status of 200 when it loads.
What I'm trying to accomplish: I want the user to receive an http status of 404 (or respective status code), and I want the page to recreate always (regardless of extension or lack of extension). I do not want a 302 redirect from IIS, and I do not want the custom error page to return as a 200.
I'm new to IIS - This seems like it would be a basic thing, but I'm having more troubles than I would've guessed :)
Thank you in advance for any assistance!

Liferay error page if at least one portlet is unavailable

I'm trying to setup a custom error page in Liferay portal if at least one portlet fails.
The portal always forwards to portlet_error.jsp and display a red zone in the portlet position.
How can I set a redirect or a forward to a page that fills the complete page layout?
Regards
Inside your JSP you can redirect to a page in Liferay, which can have just one portlet or the way you want it.
Or write your own servlet which in case of error redirects to page in liferay instead of a JSP
If the response is 404 then you can use this property in portal-ext.properties for add your custom page
layout.friendly.url.page.not.found=/html/portal/page_not_found.html

Resources