: 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
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?
More posts by @Tiffany637
3 Comments
Sorted by latest first Latest Oldest Best
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]
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.
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
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.