November 10, 2013 at 2:57 pm #72112
In my Associate child theme I have created a new 404.php which is a simple redirect to my desired ‘pretty’ 404 page at http://www.treforestvets.com/404-page
Testing this in Google shows me that I am actually soft redirecting (302) to this page, instead of returning a proper 404 code. See quote for test fetch as google http://www.treforestvets.com/gfgfgf :
HTTP/1.1 302 Moved Temporarily
Date: Sun, 10 Nov 2013 20:49:40 GMT
Server: Apache/2.2.3 (CentOS)
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Keep-Alive: timeout=15, max=100
Content-Type: text/html; charset=UTF-8
How do I fix this and return a proper 404 code and then go to my chosen page? Do I need to use .htaccess and add document 404?
My 404.php file code is simply:
CheersNovember 10, 2013 at 3:08 pm #72113November 10, 2013 at 3:14 pm #72114
Thanks, I tried the Genesis 404 page plugin and couldn’t get it working. I didn’t try very hard though, I may give it another go.
I’m afraid i’m not good enough with php to put my user-friendly 404 page into 404.php. I made a copy of the default genesis 404 in my child theme and edited it but broke the whole websiteNovember 10, 2013 at 3:21 pm #72115
When you copied the default 404.php to your child theme, did it work before you started editing it? If so, I’d try adding little bits of your HTML at a time, and then figure out which bit of code you added actually did the breaking.
You might just have a problem echoing out the HTML content you want in between the PHP functions of the rest of the template.
November 10, 2013 at 3:53 pm #72123
yes, it worked fine. Unfortunately I don’t understand .php well enough (i.e. at all!) to make it use a normal ‘page’ template and then edit it from there. I don’t understand what an echo is
I’ll give the 404 plugin another goNovember 10, 2013 at 3:57 pm #72124
I’ve reactivated the 404 pages plugin and it works to a point. I’ve remembered now what the main problem was:
using the 404 plugin, it upsets the layout of that page as compared to a standard pageNovember 10, 2013 at 4:12 pm #72127
Got it sorted now. I think it was something idiotic like me missing a </div> that was causing the footer to break. Hooray, I don’t have to learn .phpNovember 10, 2013 at 4:32 pm #72134
You must be logged in to reply to this topic.