How to enable default 404 error page display in shopware 6? - shopware

How to enable default 404 error page display in shopware 6?
I can't find the section to enable 404 error handling

The 404 error page should automatically show up once you set the APP_ENV=prod in your .env file.
When APP_ENV=dev the symfony error page will show up instead, so you can better figure out what went wrong while trying to load the page.

Related

www.server.com/*.aspx returns server error rather than custom error

I have updated my customerr folder to have a common error page which will be displayed for any sort of error.
www.server.com/wrongone
takes to me to the custom error page. -> Working fine
www.server.com/correctone/wrongone.aspx -> This is handled at application level, so I have no problem with this.
But when I hit www.server.com/wrongone.aspx,
It displays Server error. -> I dont want to display server error
What should I do ( at IIS Level) to redirect this to custom error page?
It depend on what status did you get. To set custom error page for .aspx file, you should set .NET error page <customError> instead of error page.
You could find it in IIS manager->site node->.NET error page and you need to add rule for your status code/error page. When you hit the error status code, the page will be redirected to your custom error page. If your status code is 500, then custom page would fail in some case.
https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh831398(v%3Dws.11)

Facebook Socialite Error 404: Page not found

I am setting up Facebooking socialite on my existing website and encountered an 404 error when I click "Login With Facebook " button. The error is:
Sorry, the page you are looking for could not be found.
I don't know whether the error is from the routing or it is from something else.
The designate url for the button is: https://ktest1.domainforplaying.com/auth/redirect/facebook
You need to setup routes for socialite to use to connect to Facebook. Please see the official documentation:
https://laravel.com/docs/6.x/socialite#routing

Redirect to custom error page instead of default liferay error page

I want to redirect user to own error page instead of default liferay error page.I am using 6.1.1 CE ga2.
I tried
layout.show.http.status=true
layout.friendly.url.error=/error
inside portal-ext but no luck.
As you haven't specified for which type of error's you need to display custom error pages so i am showing it for 500.You can implement for others.
Add following configuration in the application server web.xml.
$TOMCAT_HOME/conf/web.xml
<error-page>
<error-code>500</error-code>
<location>/ErrorPages/Error500.jsp</location>
</error-page>
Make changes for redirection in the error pages.
< script>location.href='/web/ip/login';< / script >
you can also achieve it through ext plugin . I never tried it. i will try and let u know
Solution 1
Show Error Page:-
Step 1:- Go to portal servers
liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\ROOT\html
Create new folder with name “error”
Step 2 :- Paste attached image (accessDenied.png) in new created path
liferay-portal-6.1.1-ce-ga2\tomcat-7.0.27\webapps\ROOT\html\error
Step 3 Change in
portal-ext.properties
Add new token
layout.friendly.url.page.not.found=/html/error/accessDenied.png
Step 4 Restart the server.
This solution will display error png in case of Error code 404 .
Solution 2 :-
Go to tomcat-7.0.27\webapps
Go to each portlet and create new folder images if not available.
Paste attached accessDenied.png in images folder.
Go to WEB-INF of each portlet and edit web.xml .
Add
<error-page>
<error-code>404</error-code>
<location>/images/accessDenied.png</location>

Get Page URL on 404 IIS Redirection (Custom Error Page in Classic ASP)

I have implemented IIS Redirection on 404 error code and created a Custom Error Page for it. My Custom error page is written in classic asp (e.g: FileNotFound.asp). I need to write the URL of calling page (which does not exists) in my Custom Error Page.
You need the following:
Request.ServerVariables (server_variable)
Replace it with:
Request.ServerVariables (HTTP_REFERER)
That should work. Article on it at w3Schools: http://www.w3schools.com/asp/coll_servervariables.asp

Symfony2 is_granted('IS_AUTHENTICATED_FULLY') during 404 error page display, causing ResourceNotFoundException

I have setup custom error pages to display for certain HTTP errors in the folder:
app/Resources/TwigBundle/views/Exception/
The 403 page (error403.html.twig) works and displays as expected.
The 500 page (error500.html.twig) works and displays as expected.
The 404 page (error404.html.twig) throws a 500 server error:
PHP Fatal error: Uncaught exception 'Symfony\Component\Routing\Exception\ResourceNotFoundException'
The error is being thrown by doing an auth check to display certain menu items for users that are or aren't authenticated:
{% if is_granted('IS_AUTHENTICATED_FULLY') %}
If I remove that check and just allow all menu items to display, the page loads the error page as expected. Again, the 403 page displays as it should and utilizes the auth checks without a problem.
I'm stuck on this one. The pages are EXACTLY the same, apart from the filename.
If symfony < 2.8 :
{% if app.user is not null and is_granted('ROLE_ADMIN') %}
See : https://github.com/symfony/symfony-docs/issues/2078
Edit from Dec 17 '15:
This is no longer needed since 2.8,
{% if is_granted('ROLE_ADMIN') %}
works fine now.
source: http://symfony.com/blog/new-in-symfony-2-8-dx-improvements#allow-to-check-for-security-even-in-pages-not-covered-by-firewalls
You can't use the is_granted in a 404 page since 2.1:
It's mentioned in the upgrade file
The Firewall listener is now registered after the Router listener. This means that specific Firewall URLs (like /login_check and /logout) must now have proper routes defined in your routing configuration. Also, if you have a custom 404 error page, make sure that you do not use any security related features such as is_granted on it.
See:
https://github.com/symfony/symfony/blob/master/UPGRADE-2.1.md#security
I would suggest checking for app.security.token to be more strict and evaluate to true even when user is anonymous.
If you check for app.user it will evaluate false in Exception templates, but even when the firewall is present (= regular templates) but the user is not logged. This will prevent - for example - the display of a login button.
See: https://github.com/symfony/symfony-docs/pull/2359

Resources