Last active
August 23, 2017 20:22
-
-
Save imelgrat/d72312c203955424c6ce to your computer and use it in GitHub Desktop.
Redirecting WordPress to the homepage. Full article at: http://imelgrat.me/wordpress/dead-links-redirect-avoid-seo-impact/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 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. If it doesn’t exist, then create a blank .php file. Paste the following code in there: | |
header("HTTP/1.1 301 Moved Permanently"); | |
header("Location: " . get_bloginfo('url')); | |
exit(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment