Skip to content

Instantly share code, notes, and snippets.

@imelgrat imelgrat/404.php

Created Feb 15, 2019
What would you like to do?
Redirect WordPress dead-links to the homepage
* Redirect missing WordPress URLs .
* If you want to redirect the browser every time a page can’t be found while avoiding SEO impact, you can open your 404.php file
* in your theme’s folder and paste this at the top. If it doesn’t exist, then create a blank 404.php file.
* @link
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . get_bloginfo('url'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.