Sponsored Content
Top Forums Web Development New "Page Not Found" (404) Page Post 303026023 by Neo on Sunday 18th of November 2018 12:15:44 AM
Old 11-18-2018
New "Page Not Found" (404) Page

Made some changes to the forum, so when a page is not found and generates a 404 error, the site redirects to "Today's Posts" page and added a "Not Found" message:

Code:
<?php
header('HTTP/1.0 404 Not Found', true, 404);
header("Location: https://www.unix.com/search.php?do=getdaily&redirect=404");
die();
?>

Results, for example:

Image
This User Gave Thanks to Neo For This Post:
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"Elements per page"... seeking ideas...

I work for a web hosting company uses Apache. We like to come up with composite models of what our customers do so that we can tailor our servers to what they need. One question we like to answer is, "For a given page downloaded from our customer's virtual server, what is the mean number of... (2 Replies)
Discussion started by: treesloth
2 Replies

2. Web Development

CGI not working with httpd server on busybox 1.15.0 on ltib Linux 2.6.34 (404 page not found)

I have some industrial ARM linux board with 2.6.34 Linux on it with Busybox v1.15.0. The https.conf is located in /etc/ and contains: H:/root/web In the www directory I also have 'cgi-bin' folder with chmod 777 and in that folder a file called 'testcgi'. Now I start the server with... (1 Reply)
Discussion started by: Roboserg
1 Replies

3. Web Development

Quick Fix for Google Search Console "Page is not mobile friendly"

Over the past 10 plus years, we have countless posts where the user did not use CODE tags or they used ICODE tags incorrectly. This has has the results of this site penalized by Google for having pages which are "not mobile friendly". So, working quietly in the background, in the thankless... (0 Replies)
Discussion started by: Neo
0 Replies

4. What is on Your Mind?

New Responsive 404 Page for UNIX.com

Just created (actually, only modified... it was created by ShoutOut) a new responsive 404 "not found" page with the help of ShoutOut free templates. https://www.unix.com/status/404.html Same for 401 and 403 errors. Picture sans animation: ... (2 Replies)
Discussion started by: Neo
2 Replies
OnlinePayment::HTTPS(3pm)				User Contributed Perl Documentation				 OnlinePayment::HTTPS(3pm)

NAME
Business::OnlinePayment::HTTPS - Base class for HTTPS payment APIs SYNOPSIS
package Business::OnlinePayment::MyProcessor; use base qw(Business::OnlinePayment::HTTPS); sub submit { my $self = shift; #... # pass a list (order is preserved, if your gateway needs that) ( $page, $response, %reply_headers ) = $self->https_get( field => 'value', ... ); # or a hashref my %hash = ( field => 'value', ... ); ( $page, $response_code, %reply_headers ) = $self->https_get( \%hash ); #... } DESCRIPTION
This is a base class for HTTPS based gateways, providing useful code for implementors of HTTPS payment APIs. It depends on Net::HTTPS::Any, which in turn depends on Net::SSLeay _or_ ( Crypt::SSLeay and LWP::UserAgent ). METHODS
https_get [ \%options ] HASHREF | FIELD => VALUE, ... Accepts parameters as either a hashref or a list of fields and values. In the latter case, ordering is preserved (see Tie::IxHash to do so when passing a hashref). Returns a list consisting of the page content as a string, the HTTP response code and message (i.e. "200 OK" or "404 Not Found"), and a list of key/value pairs representing the HTTP response headers. The options hashref supports setting headers: { headers => { 'X-Header1' => 'value', ... }, } https_post [ \%options ] SCALAR | HASHREF | FIELD => VALUE, ... Accepts form fields and values as either a hashref or a list. In the latter case, ordering is preserved (see Tie::IxHash to do so when passing a hashref). Also accepts instead a simple scalar containing the raw content. Returns a list consisting of the page content as a string, the HTTP response code and message (i.e. "200 OK" or "404 Not Found"), and a list of key/value pairs representing the HTTP response headers. The options hashref supports setting headers and Content-Type: { headers => { 'X-Header1' => 'value', ... }, Content-Type => 'text/namevalue', } SEE ALSO
Business::OnlinePayment, Net::HTTPS::Any perl v5.12.4 2010-05-25 OnlinePayment::HTTPS(3pm)
All times are GMT -4. The time now is 05:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy