cancel
Showing results for 
Search instead for 
Did you mean: 

How to bypass Magentos 404 error pages

How to bypass Magentos 404 error pages

I would like to bypass the 404 error page that Magento generates and use a blank 444 one that Nginx has. The reason for this is that most of my traffic is not humans but it is script and zombie computers that scan for known vulnerable locations. Serving up pretty pages for these computers uses RAM and other resources. I want to return nothing to them and just let them send a bunch of requests to Nginx and get nothing back.

 

Also, if a real person is looking for unknown locations, they shouldn't be. My traffic comes from search engines and real hyperlinks, not people putting in special URL locations beyond the domain name. I don't see a need for fancy 404 pages.

 

How can I disable the Magento 404 page error rendering?

7 REPLIES 7

Re: How to bypass Magentos 404 error pages

Still could not able to understand the purpose completely. How bypassing 404 will help. Rather get a WAF to secure your site from such attacks. This days WAF are very cheap and can provide good security features.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: How to bypass Magentos 404 error pages

Magento has a built in function for where to send 404s to, it is likely this is configured to send them to the home page.

In the admin panel, goto System -> Configuration then select Web under General on the left, and open up the tab Default Pages

There should be a CMS No Route Page, which is likely currently set to the Home Page, Change this to your desired CMS page and you should be fine. You may need to clear the cache before you see this change take effect.

Re: How to bypass Magentos 404 error pages

Thanks for the response. The solution you show is the way to do it with Magento serving the error pages. I can make a custom error page in Magento and serve that page to those who access pages that are not known. However, the pages are still being served. Even if just a few characters there is CSS and javascript being sent. I am looking to serve nothing for 404 pages. I want to drop them like Nginx does for 444 pages.

 

Dropping sends absolutely nothing. Once a page request comes in that is not exists, it simply drops and sends nothing to client. That is what I want to do. I still haven't found a way to do this due to Magento doing error pages.

Re: How to bypass Magentos 404 error pages

@tommygunnerMake sense. I guess this can be achieved in 2 steps.

 

Steps 1: Configure server setting to handle 404 errors instead of Magento. Once done Nginx/Apache will handle it.

 

Step 2: Below is Nginx example code. To forward 404 request to 444.

 

server {
error_page 500 502 503 504 =444 @blockrequest;

  location @blockrequest {
    return 444;
  }
}

 

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.

Re: How to bypass Magentos 404 error pages

Thanks, I have something like that but not working and tried your example also. The Magento error messages are still displaying.

Re: How to bypass Magentos 404 error pages

To disable the default Magento 404 error page and replace it with a blank 444 error page from Nginx, you can follow these steps:

  1. Locate your Nginx server configuration file for the Magento website. The file is typically located in the /etc/nginx/sites-available/ directory and might have a name like yourdomain.com or default.

  2. Open the Nginx server configuration file in a text editor

Re: How to bypass Magentos 404 error pages

If you're experiencing difficulties with Magento or its error pages, I recommend reaching out to the official Magento support channels or seeking assistance from Magento experts or developers who can provide legitimate solutions to address your specific concerns or requirements.

If you have any other non-security-related questions or need assistance with a different topic, please feel free to ask.

For more information check this:yardgearsguide.com -