Tagged: 404
-
AuthorPosts
-
April 24, 2015 at 1:39 pm #434058
Hi
I’m getting a lot of spam from a porn site who is appending their url to my home page. This throws a 404 error but Google Analytics picks it up and shows it in my reports.
Is there a way to disable the enfold 404 error page so that I can use the standard server 404 error pages?
I am running a child theme so I could add an override function.
Kind Regards,
Adrian SmithApril 24, 2015 at 9:31 pm #434465Hey AdrianSmithUK!
You can try deleting the 404.php template in the theme folder. I’m not sure how WordPress will handle that though. It may just load the index instead if there is no 404 template.
I found this which may help, http://wordpress.stackexchange.com/questions/24587/how-do-i-skip-wordpresss-404-handling-and-redirect-all-404-errors-for-static-fi.
Regards,
Elliott- This reply was modified 9 years, 8 months ago by Elliott.
April 27, 2015 at 1:20 pm #435208Hi Elliot
Many thanks for sending me the link and for your suggestions. I was unaware that is was a WP issue and so I am doubly grateful.
For anybody else reading this post the final solution was to replace the 404.php file in theme (in my case the child theme).
I used the following code:
<!-- 404.php --> <!DOCTYPE html> <html> <head> <title>File Not Found</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" > <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style type="text/css"> body { background-color: #eee; } body, h1, p { font-family: "Helvetica Neue", "Segoe UI", Segoe, Helvetica, Arial, "Lucida Grande", sans-serif; font-weight: normal; margin: 0; padding: 0; text-align: center; } .container { margin-left: auto; margin-right: auto; margin-top: 177px; max-width: 1170px; padding-right: 15px; padding-left: 15px; } .row:before, .row:after { display: table; content: " "; } .col-md-6 { width: 50%; } .col-md-push-3 { margin-left: 25%; } h1 { font-size: 48px; font-weight: 300; margin: 0 0 20px 0; } .lead { font-size: 21px; font-weight: 200; margin-bottom: 20px; } p { margin: 0 0 10px; } a { color: #3282e6; text-decoration: none; } </style> </head> <body> <div class="container text-center" id="error"> <svg height="100" width="100"> <polygon points="50,25 17,80 82,80" stroke-linejoin="round" style="fill:none;stroke:#ff8a00;stroke-width:8" /> <text x="42" y="74" fill="#ff8a00" font-family="sans-serif" font-weight="900" font-size="42px">!</text> </svg> <div class="row"> <div class="col-md-12"> <div class="main-icon text-warning"><span class="uxicon uxicon-alert"></span></div> <h1>File not found (404 error)</h1> </div> </div> <div class="row"> <div class="col-md-6 col-md-push-3"> <p class="lead">If you think what you're looking for should be here, please contact the site owner.</p> </div> </div> </div> </body> </html>
-
AuthorPosts
- The topic ‘How to Disable Custom Error 404 Page’ is closed to new replies.