开发者

How to call customized template page before hitting 404 in wordpress

In Wordpress, I need to call my own page when t开发者_开发知识库here are no pages available. This should happen before hitting a 404 page. How can I customise Wordpress to have this behaviour?


That has nothing to do with Wordpress or Django. ;-)

<?php
   header("Status: 301 Moved Permanently");
   header("Location:/");
?>

Input the URL you prefer to be relocate for "Location:". In my case it will relocate to the root-page.

EDIT: You can make your special template then create a page and set your special template as page template or you can simple create a static html page. In both cases you have then to set "Location:" to the URL of your 404-page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜