|
#1
Jun 7, 2009, 04:29 PM
|
|
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?
|
#2
Jun 10, 2009, 09:18 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
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
|
#3
Jun 10, 2009, 05: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.
|
#4
Jul 26, 2009, 05: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!
|
#5
Aug 14, 2009, 08:05 AM
|
|
|
72 posts · Mar 2009
Prague
|
|
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
|
#6
Aug 14, 2009, 09:35 AM
|
|
|
72 posts · Mar 2009
Prague
|
|
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
|
#7
Aug 14, 2009, 10:40 AM
|
|
|
72 posts · Mar 2009
Prague
|
|
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
|
#8
Aug 15, 2009, 07:36 AM
|
|
|
72 posts · Mar 2009
Prague
|
|
OK, here we go, my personal take at how to create a custom error 404 Wordpress page, SY
|
#10
Dec 7, 2012, 02: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.
|
#11
Dec 7, 2012, 04:32 PM
|
|
|
|
10,176 posts · Jul 2009
Central New York State USA
|
|
You can copy the 404.php from the TwentyEleven theme folder and put it in the Atahualpa theme folder. Edit as you wish.
__________________
~Larry ( CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
|
#12
Dec 10, 2012, 07:37 PM
|
|
Quote:
Originally Posted by lmilesw
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.
|
|