Mobile app version of vmapp.org
Login or Join
Tiffany637

: Check for URLs that return my 404 error page I have made a custom 404 error page called error_404.html In my .htaccess I inserted: ErrorDocument 404 /error_404.html In order to control/correct

@Tiffany637

Posted in: #Htaccess #Redirects

I have made a custom 404 error page called error_404.html

In my .htaccess I inserted:

ErrorDocument 404 /error_404.html


In order to control/correct 404 errors in my website, I would like to know which URL requests return this page.

Is there a way I can check which URL or log requests that return the error_404.html page?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

3 Comments

Sorted by latest first Latest Oldest Best

 

@YK1175434

This works: emulating ErrorDocuments with mod_rewrite.

ErrorDocument 404 /404.html
Redirect 404 /404
RewriteCond %{ENV:REDIRECT_STATUS} !=404
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /404 [L]

10% popularity Vote Up Vote Down


 

@Jamie184

You do not need a custom error document in order to monitor 404's on your site - if that is the requirement. All the information is in your server access log. The HTTP response code (ie. 404, 403, 200, etc) and the URL of the request that produced that response.

The custom error document is a nice way of serving a meaningful response to users.

You can also register your site with Google Webmaster Tools (GWT). This will produce a report of all the URLs that it attempted to crawl (ie. URLs that it could find) that produced a 404.

Bare in mind that your access log will report a lot more 404s than GWT because there are a lot of nasty bots out there looking for vulnerabilities that will try to request all sorts of URLs that might be unrelated to your site. Ignore these, or block the bots if they are persistent.

10% popularity Vote Up Vote Down


 

@Alves908

I do not believe so. Not using ErrorDocument the way you have specified.

Here is a resource site that seems to have some answers.
www.askapache.com/htaccess/htaccess.html#Custom_ErrorDocuments
Scroll down and you will find this example. If it is not exactly what you want, it can be modified.

### ALTERNATATIVE TO USING ERRORDOCUMENT
# www.htaccesselite.com/d/htaccess-errordocument-examples-vt11.html RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /error.php [L]


You can also check out for more information:
www.askapache.com/htaccess/security-with-htaccess.html#errordocument-usage-in-htaccess

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme