Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   [SOLVED] how to override Atahualpa default 404's? (http://forum.bytesforall.com/showthread.php?t=1963)

gjt Jun 7, 2009 03:29 PM

[SOLVED] how to override Atahualpa default 404's?
 
Atahualpa has "overidden" my sites custom 404 error page as specified in .htaccess. I discovered it has to do with the WP Permalink coding in .htaccess since if I remove this code, my custom 404 works as it should.

I have a large site of which WP is only a part, albeit an important part (it's installed in a /blog subdirectory). However, I'd rather have my custom 404 page with all my standard navigational templates used sitewide than the "404" (technically I don't think it's really a 404 page, though I certainly be wrong about that) generated by the blog theme which, of course, uses the Atahualpa templates.

How can I wrestle control of my 404 page back from WP/Atahaulpa?

Flynn Jun 10, 2009 08:18 AM

This is not Atahualpa specific. The default Wordpress .htaccess file redirects every non-existing file or directory request inside the Wordpress directory to Wordpress. This should not take over the non-WP parts of your site, unless you have the .htaccess file at domain.com/.htaccess and the Wordpress installation at domain.com/blog-directory. In that case you may have to add

RewriteBase /blog-directory

to the .htaccess file, or move it to the Wordpress directory

http://httpd.apache.org/docs/1.3/mod...ml#RewriteBase

You can also make a copy of Atahualpa's index.php as 404.php and edit that file

gjt Jun 10, 2009 04:40 PM

Thanks Flynn. You got me going on the right track.

For those of you keeping score at home...

My mistake was placing the WP Permalink code in my root directory .htaccess. With my particular configuration that Permalink code needed to be in a separate .htaccess located in the mydomain.com/blog directory (i.e. the root directory for my blog...as you pointed out). I hadn't realized you could have multiple .htaccess files on a single site...they just have to reside in different directories.

I never tried RewriteBase though I'm sure that would work too.

In any event, I now have the best of both worlds. My static site displays custom error pages based on my static site templates and my blog displays 404 errors based on Atahualpa templates.

Neceros Jul 26, 2009 04:14 AM

I have a question in the same regard: What's the best way to edit what's shown for 404? Basically, if instead of putting up a 404 at all, could I just redirect someone to a default page?

I'm not sure if that would be the work of my theme, or a plugin. Thanks!

hospitalera Aug 14, 2009 07:05 AM

I had the same idea as Neceros, I created a page that I want to have displayed each time when a 404 error occurs. So, how do I do a redirect to display that page now instead of the "normal" 404 error page. SY

hospitalera Aug 14, 2009 08:35 AM

OK, I found out that I have to add

ErrorDocument 404 http://hospitalera.com/welcome/

to my .htaccess file, but whichever location I try out inside the file, it doesn't work, and yes I cleared my cache between attempts. Where is my mistake? SY

hospitalera Aug 14, 2009 09:40 AM

OK, I found my own answer. Basically you have to create a 404.php file, add the content you want to show and upload it to your Atahualpa theme folder. Just done it and it works fine in FF and IE. Now I am a tiny bit exhausted because I have never touched php before ;-) If there is interest I can post a link to my, planned, blog post "How to make your own Atahualpa custom error page" when it is written, see ya, SY

hospitalera Aug 15, 2009 06:36 AM

OK, here we go, my personal take at how to create a custom error 404 Wordpress page, SY

WinObs May 28, 2010 06:15 AM

Thanks for the code on showing recent posts - added it to my own 404

http://www.windowsobserver.com/404.php

runnerb0y Dec 7, 2012 01:05 PM

WinObs,

Sorry to dig up this thread, but I'm trying to build a custom 404 page as well. When I used the example 404.php code on my ATA 3.7.9 site, it bombs. I've created many .php files so there's not an issue there (in terms of file being a true text file, proper file permissions, etc..). The example code crashes on line 9.

I like the look of your 404 page, what did you do to achieve that?

TIA for any assistance.

lmilesw Dec 7, 2012 03:32 PM

You can copy the 404.php from the TwentyEleven theme folder and put it in the Atahualpa theme folder. Edit as you wish.

runnerb0y Dec 10, 2012 06:37 PM

Quote:

Originally Posted by lmilesw (Post 93484)
You can copy the 404.php from the TwentyEleven theme folder and put it in the Atahualpa theme folder. Edit as you wish.

lmilesw,

That worked perfectly. Also I found out that a search that returned nothing wasn't going to my custom 404.php page but simply by duplicating the 404.php to a file named search.php, it all works well. Not sure this is the best solution, but it's easy and it works so I'll stick with it until I see it's causing me trouble.

Thanks for the assist.


All times are GMT -6. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.