Home (wordpress) How to Redirect 404 page errors to your theme's 404.php
Reply: 0

(wordpress) How to Redirect 404 page errors to your theme's 404.php

Timitom
1#
Timitom Published in 2018-02-11 16:21:11Z

With the following code in my theme's 404.php I can easily 301 redirect any non-existent page to the main page :

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

However I'd like to redirect all users to the theme's default 404 cause it contains some straightforward information and a search bar that I can use to my advantage.

BTW, I don't want to make a customized page and redirect them to that static page.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.308098 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO