{"id":831,"date":"2007-06-14T12:53:03","date_gmt":"2007-06-14T11:53:03","guid":{"rendered":"http:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/2007\/06\/14\/script-php-pour-une-page-404-aleatoire\/"},"modified":"2007-06-14T13:53:07","modified_gmt":"2007-06-14T11:53:07","slug":"script-php-pour-une-page-404-aleatoire","status":"publish","type":"post","link":"https:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/2007\/06\/14\/script-php-pour-une-page-404-aleatoire\/","title":{"rendered":"Script PHP pour une page 404 al\u00e9atoire"},"content":{"rendered":"<p>Certains visiteurs m&rsquo;ont demand\u00e9 comment je me d\u00e9brouillais pour orienter de mani\u00e8re al\u00e9atoire vers une larg s\u00e9lection de messages <a href=\"\/404.php\">404 page not found<\/a> comme on le voit sur mon site web.<\/p>\n<p>Donc, sans plus de chichis, voici le script PHP que j&rsquo;utilise pour assurer cette redirection al\u00e9atoire dynamique:<\/p>\n<pre lang=\"php\">\r\n&lt;?PHP\r\n\t$address_list = array(\r\n\t\t\"\/404\/404-01.php\",\r\n\t\t\"\/404\/404-02.php\",\r\n\t\t\"\/404\/404-03.php\",\r\n\t\t\"\/404\/404-04.php\",\r\n\t\t\"\/404\/404-05.php\",\r\n\t\t\"\/404\/404-06.php\",\r\n\/*\t\t\"\/404\/404-07.php\",\t*\/\r\n\t\t\"\/404\/404-08.php\",\r\n\t\t\"\/404\/404-09.php\",\r\n\t\t\"\/404\/404-10.php\",\r\n\t\t\"\/404\/404-11.php\",\r\n\t\t\"\/404\/404-12.php\",\r\n\t\t\"\/404\/404-13.php\",\r\n\t\t\"\/404\/404-14.php\",\r\n\t\t\"\/404\/404-15.php\",\r\n\t\t\"\/404\/404-16.php\",\r\n\t\t\"\/404\/404-17.php\",\r\n\t\t\"\/404\/404-18.php\",\r\n\t\t\"\/404\/404-19.php\",\r\n\t\t\"\/404\/404-20.php\",\r\n\t\t\"\/404\/404-21.php\",\r\n\t\t\"\/404\/404-22.php\",\r\n\t\t\"\/404\/404-23.php\",\r\n\t\t\"\/404\/404-00.php\"\r\n\t);\r\n\tsrand((double)microtime()*1000000); \r\n\t$randomtopic = rand(0,count($address_list));\r\n\theader('Location: '.$address_list[$randomtopic]);\r\n\texit;\r\n?&gt;<\/pre>\n<p>Vous pouvez le copier et le r\u00e9-utiliser sur votre propre site web. C&rsquo;est offert !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Certains visiteurs m&rsquo;ont demand\u00e9 comment je me d\u00e9brouillais pour orienter de mani\u00e8re al\u00e9atoire vers une larg s\u00e9lection de messages 404 page not found comme on le voit sur mon site web. Donc, sans plus de chichis, voici le script PHP que j&rsquo;utilise pour assurer cette redirection al\u00e9atoire dynamique: &lt;?PHP $address_list = array( \u00ab\u00a0\/404\/404-01.php\u00a0\u00bb, \u00ab\u00a0\/404\/404-02.php\u00a0\u00bb, \u00ab\u00a0\/404\/404-03.php\u00a0\u00bb, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44,36,55],"tags":[],"class_list":["post-831","post","type-post","status-publish","format-standard","hentry","category-blog","category-creer-un-site","category-php"],"_links":{"self":[{"href":"https:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/wp-json\/wp\/v2\/posts\/831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/wp-json\/wp\/v2\/comments?post=831"}],"version-history":[{"count":0,"href":"https:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/wp-json\/wp\/v2\/posts\/831\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/wp-json\/wp\/v2\/media?parent=831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/wp-json\/wp\/v2\/categories?post=831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.roumazeilles.net\/news\/fr\/wordpress\/wp-json\/wp\/v2\/tags?post=831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}