Close Menu
    Facebook X (Twitter) Instagram
    • Articles
    • How it Works
    • Our Story
    • Contact Us
    Facebook X (Twitter) Instagram Pinterest Vimeo
    IT Beginner
    • Home
    • Blog
      • Happiness
      • Productivity
      • Leadership
    • About us
    • Contact us
    IT Beginner
    WordPress

    How to redirect 404 to homepage in wordpress

    18/07/2017No Comments1 Min Read

    Want to redirect 404 error page to your homepage in wordpress? Here is how

    Login to your wordpress admin page http://website.com/wp-admin/
    Go to “Apperarance” -> “Editor” -> 404.php

    If your theme doesnt have 404.php page, create one under your theme directory wp-content/themes/themename/

    Change or create your 404.php code to these

    <?php
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: ".get_bloginfo('url'));
    exit(); ?>

    What those code does is to tell browswer that page has moved permantly with 301 error code, then redirect to your home page.

    redirect wordpress
    Previous ArticleHow to install mod_rewrite on Ubuntu
    Next Article How to upgrade Linux Mint 14 to Linux Mint 15

    Related Posts

    Tips – Tricks

    Optimize WordPress with Nginx

    04/08/2017
    CentOS

    How To Install WordPress with nginx on Centos 6

    02/08/2017
    WordPress

    Remove WordPress X-Pingback header

    25/07/2017
    Subscribe
    Notify of
    guest

    guest

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    0 Comments
    Oldest
    Newest Most Voted
    Inline Feedbacks
    View all comments
    • Productivity
    • Leadership

    No posts

    No posts

    Subscribe to Newsletter
    Our Socials
    • Instagram
    • Facebook
    • Twitter
    • YouTube
    • LinkedIn

    Archives

    • April 2025
    • May 2024
    • March 2023
    • July 2022
    • March 2022
    • July 2020
    • January 2019
    • August 2018
    • July 2018
    • August 2017
    • July 2017
    • September 2016

    Categories

    • Business
    • CCNA 1 Instructor Materials
    • CentOS
    • Database
    • Debian
    • Fedora
    • Firefox
    • Happiness
    • Hardware
    • ICND1 Labs
    • ICND2 Labs
    • Leadership
    • Linux Essentials
    • Linux Mint
    • Marketing
    • My SQL
    • Netflix
    • Networking
    • Productivity
    • Resources
    • Security
    • SEO
    • Server
    • Social Media
    • Software
    • Tips – Tricks
    • Ubuntu
    • Uncategorized
    • User Experience
    • WordPress
    • Xubuntu

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna accumsan in scelerisque.

    Facebook X (Twitter) Instagram Pinterest

    Type above and press Enter to search. Press Esc to cancel.

    wpDiscuz