WP 404 Error Template

Discussion in 'WordPress' started by WACMan, Sep 5, 2007.

  1. #1
    I have a 404 template in my Wordpress theme - I want to redirect all 404's to front page.

    <?php get_header(); ?>
    
        <div id="content" class="narrowcolumn">
    
            <h2 class="center">Error 404 - Not Found</h2>
    
        </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>
    Code (markup):
    Can I put a javascript redirect in here instead of the text??

    Is there a better way??

    Edit: Reason is I need to add an ID to the url and do not want to have to 301 already indexed posts
     
    WACMan, Sep 5, 2007 IP
  2. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i would use the following

     
    just-4-teens, Sep 5, 2007 IP
    WACMan and LadyHoldem like this.
  3. WACMan

    WACMan Peon

    Messages:
    253
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, That worked!

    Trying some plug ins but these seem to get the job done!
     
    WACMan, Sep 5, 2007 IP
  4. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #4
    no problem
     
    just-4-teens, Sep 6, 2007 IP