Jump to content


Photo

Enabling 404


This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1 martyn

martyn

    Member

  • Members
  • PipPip
  • 15 posts

Posted 01 June 2010 - 08:52 AM

Hi. I have customised my 404 page but it does not seem to appear. Do I need to enable the custom 404 somewhere? It's not clear to me how I get this feature working. Thanks. Martyn

#2 bryan-hadaway

bryan-hadaway

    Advocate

  • Members
  • PipPipPipPipPip
  • 3697 posts

Posted 01 June 2010 - 10:22 AM

There are 2 options to consider:

1. You can add this to your .htaccess file (which is located in the root folder along side all your other WordPress files):

 ErrorDocument 404 /sitemap/

changing /sitemap/ to whichever path you wish.

2. You can use the plugin "Redirection" (Just search for it from your Plugins > Add New page) to redirect 404 pages to anything you want.

Thanks, Bryan

#3 martynglanvillegmailcom

martynglanvillegmailcom

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 04 June 2010 - 07:20 AM

Thanks Bryan. 1. I do not have a .htaccess file anywhere in my setup. Have searched and there is nothing. 2. I installed the Redirection plugin but, frankly, could not make any sense of how it works. (It asked for the URL that needs to redirect to the 404?) I find this disappointing and frustrating, as you can imagine. I will have to accept for now that my EcoPro site is going to fail users who encounter a 404. I really wish this could be enabled in a much simpler way. Martyn

#4 bryan-hadaway

bryan-hadaway

    Advocate

  • Members
  • PipPipPipPipPip
  • 3697 posts

Posted 04 June 2010 - 07:57 AM

Okay, here's an absolute sure way to get exactly what you want; from your WordPress admin, navigate to:

Appearance > Editor > 404 Template (404.php)

and at the very top, add this line of code:

 <?php header('location: /'); ?>

change / to the exact, full URL of whatever you want.

Thanks, Bryan

#5 martyn

martyn

    Member

  • Members
  • PipPip
  • 15 posts

Posted 06 June 2010 - 10:38 AM

Hi Bryan. I appreciate your efforts to fix this. Still not working, alas. This is the code in my 404.php template: <?php header('location: http://www.prosocial.../?page_id=1107'); ?> <?php /* This theme is Copyright © 2008-2009 Andrew Powers, PageLines.com (andrew AT pagelines DOT com) */ global $pagelines; get_header(); require(THEME_LIB.'/_spotlight.php'); include (THEME_LIB . '/template_posts.php'); get_footer(); ?> This is the page I want people to see when they encounter a dead / wrong link: http://www.prosocial...m/?page_id=1107 This is what they actually see: http://www.prosocial...com/missingpage with missingpage being a substitute for anything that may refer to a page that does not exist

#6 paymentsnetdirectukcom

paymentsnetdirectukcom

    Member

  • Members
  • PipPip
  • 12 posts

Posted 07 June 2010 - 10:33 AM

Hello, You need to go back to Bryan's first suggestion and implement the .htaccess option - I think. If you don't already have a .htaccess file, you can just create one very easily and upload it. ( a quick Google search on .htaccess files will get you started). When looking/checking for your existing .htaccess, remember that it will probably only be located on the server side, with your web host, don't go looking for it in the local copy of your website files on your computer. Simon

#7 martyn

martyn

    Member

  • Members
  • PipPip
  • 15 posts

Posted 07 June 2010 - 12:52 PM

Thanks all. The .htaccess solution worked in the end - it needed some configuration by my ISP to implement.