Magento 2: Use 404 page instead of autosearch - error-handling

We run Magento 2.1.7 and have the following problem:
When an URL is entered that does not exist magento starts an autosearch with the path. We want to redirect to a 404 error page if a wrong url is entered.
example:
correct url = www.domain.com/category1/product1
when you enter the url with a spelling mistake (www.domain.com/category1/ppproduct1) magento redirects to search page and starts searching after "category1 ppproduct1"
any ideas how to prevent this?

Go to admin panel and find the following option.
store->configuaration->web->Find the "Default Pages" option
CMS No Route Page : 404 Not Found
Change this setting and check. Clear cache.

Related

How to fix a 404 problem related to URL Segment in Typo3 v9.5.9

I'm using an Typo3 new updated website 9.5.9, www.mywebsite.com/mypage1 url generate a 404 page, but when i try this www.mywebsite.com/mypage1?no_cache=1 is working.
I have already tried empty cache.
I also tried upgrading from 9.5.7 tp 9.5.9.
Code error is : 404 Not Found.
Any body have some idea ?
Thanks!
Either the Site Configuration is wrong or not set. Check the Base URL .
Or your URL Slug of that page is different than you expected. Maybe TYPO3 added a "1" at the end of the URL Slug, because that excact URL Slug is already being used somewhere in the Database (See Tables "pages", Field "slug"). If you need it to be that excact URL Slug, then delete the wrong page in the database and after that recreate the URL Slug in the page settings.
The server admin have found the problem, it was from nginx server configuration under etx/nginx i don't know what he really changed but it is not a typo3 problem.
Thank you for your reply!

Apache htaccess ErrorDocument directive not working

I found a vulnerability for content-spoofing on my webpage.
This URL:
https://www.mygreatsite.com/www.mygreatsite.com%20has%20moved%20to%20www.evilsite.com.%20CHECK%200UT%20H0W%20COOL%20THE%20NEW%20SITE%20IS!%20Sadly,%20the%20file%00
Apache Output:
Not Found
The requested URL /www.mygreatsite.com has moved to www.evilsite.com. CHECK 0UT H0W COOL THE NEW SITE IS! Sadly, the file was not found on this server.
--
The URL Overrides the Apache-Error and outputs the text added to the URL in the Browser, along with a 404-Error.
Actually, all requests to the server should be redirected to the CMS (Typo3) which in turn handles the 404-error and shows a custom page.
When I enter an URL that doesn't exist, this works perfectly. Just the above mentioned URL screws everything up.
Interestingly, when I delete the «%00» from the end of the URL, the request is forwarded to the CMS and the correct error document is displayed.
I tried to add a separate ErrorDocument-Directive to the htaccess-file - with no success.
Any ideas what goes wrong and how I could solve this?
As Anubhava points out, when a NULL-Byte is detected, Apache doesn't load any modules and just throws the 404. That's why ErrorDocument and mod_rewrite in the htaccess don't work.
[Edit for clarification]
%00 or in Hex \x00 is a NULL byte. When web server finds a NULL byte at the end then web server thinks it is a spoofing request and considers it to be dangerous to be processed by any directives.
Due to security reasons web server doesn't load any modules for this request and returns a 404 / Not found status. Browser shows default 404 page with your decoded URL just below Not Found text.

different login pages on sites on sensenet

I create more than one site on sensenet and I want to specify an login page for each site.
On site properties I can define the login page but that is not working... (I think). Every time I access without the login made I receive the follow message:
404 error The requested resource could not be found Please make sure
that the url is spelled correctly.
To go to the main page, click here
It shouldn't go to my login page defined on site settings?
What am I not picking here?
You should add at least one site URL to your new site, and also check if "Everyone" has "open" and "run application" permission on the new login page.

TYPO3 404 Error handling

There are a lot of tutorials about error 404 handling and different solutions.
If I'm using TYPO3 6.1, Fluid/Extbase and RealURL, what is the best way to make an Error 404/500 handler that uses the page Uid = 13 (error/notfound/)
If you have an error 500, TYPO3 will not be able to handle it since it is "crashed". For 404 handling you will see a list of possibilites in the install tool, section [pageNotFound_handling].
The most straight-forward way for a website with one language is to enter an absolute URL to the [pageNotFound_handling] field. The URL could point to a TYPO3 page or a static HTML site. TYPO3 will not redirect to this page, but output this page and send the proper 404 status.

serve 404 page from a folder with static files when using Joomla

I have a Joomla site running on Apache and Ubuntu 12.04. I wanted to show a custom 404 pages to be shown when a 404 error occure. I have made necessary changes to error.php file in my template directory to redirect it to '/404' directory where I have an index.html file with many images,css and java script.
Now when accessing a non-existent page, Joomla is redirecting me to root/404 but there I get a 403 Forbidden error from appache. The 404 directory is located inside 'htdocs' directory of Joomla installation.
Additional info:
1. I don't want to convert my 404 page into a Joomla template or article.
2. I am using a Joomla AMI from Bitnami on Amazon web service
If you redirect to a 404 page, you corrupt the error mechanism. The client will never get that 404 status, but a 200 on successful redirect to your error page.
Instead, you should modify your template's error.php to
send the 404 Not Found header
directly send the error page using readfile()
You might have to adjust the asset paths within your error page.
That's totally wrong, working with static pages does not mean that you have to overcome Joomla's routing.
You should either override the error Page view or use custom error pages.
Take a look at Joomla's documentation.http://docs.joomla.org/Custom_error_pages
Nibra was totally right about breaking the mechanism but still using a readfile() seems as an overkill.