On Sun, 16 Aug 2015, David E. Ross wrote:
On 8/16/2015 6:01 AM, Dedomen wrote:
On Sat, 15 Aug 2015, David E. Ross wrote:
I am trying to create my own 404 page. When someone requests a
non-existent Web page from my domain, what environment variable contains >>>> the requested path to the page?
You are using apache, nginx or something else?
Server: Apache/2.2.29
OS: Unix
Mods:
mod_ssl/2.2.29
OpenSSL/1.0.1e-fips
mod_bwlimited/1.4
mod_perl/2.0.8
Perl/v5.10.1
Sorry for the late answer. Creating custom 404 page is trivial in Apache. Here is good tutorial:
https://www.digitalocean.com/community/tutorials/how-to-create-a-custom-404-page-in-apache
On 8/18/2015 3:34 AM, Dedomen wrote:
On Sun, 16 Aug 2015, David E. Ross wrote:
On 8/16/2015 6:01 AM, Dedomen wrote:
On Sat, 15 Aug 2015, David E. Ross wrote:
I am trying to create my own 404 page. When someone requests a
non-existent Web page from my domain, what environment variable contains >>>> the requested path to the page?
You are using apache, nginx or something else?
Server: Apache/2.2.29
OS: Unix
Mods:
mod_ssl/2.2.29
OpenSSL/1.0.1e-fips
mod_bwlimited/1.4
mod_perl/2.0.8
Perl/v5.10.1
Sorry for the late answer. Creating custom 404 page is trivial in Apache. Here is good tutorial:
https://www.digitalocean.com/community/tutorials/how-to-create-a-custom-404-page-in-apache
I did all that quite some time ago. Yes, my 404 page does appear when
someone requests a non-existant page.
What I want, however, is to display the path that the visitor requested.
For example, someone might request
http://www.rossde.com/garden/xxyyzz.html
My 404 page already has coded into it
Error at <www.rossde.com>
The next line on the page says
No Such Web Page:
where I would want to see
No Such Web Page: /garden/xxyyzz.html
For that to work, I need the Apache environment variable that contains
the path that was requested.
All this worked with a prior Web host. But that host decided to
eliminate all consumer accounts, focusing only on commercial accounts.
I am very frustrated because my current host does not seem to handle
server-side includes well.
On Tue, 18 Aug 2015 16:07:46 -0700,
David E. Ross <nobody@nowhere.invalid>, in
<mr0ds4$6t8$1@news.albasani.net> wrote:
On 8/18/2015 3:34 AM, Dedomen wrote:
On Sun, 16 Aug 2015, David E. Ross wrote:
On 8/16/2015 6:01 AM, Dedomen wrote:
On Sat, 15 Aug 2015, David E. Ross wrote:
I am trying to create my own 404 page. When someone requests a
non-existent Web page from my domain, what environment variable contains >>>>>> the requested path to the page?
You are using apache, nginx or something else?
Server: Apache/2.2.29
OS: Unix
Mods:
mod_ssl/2.2.29
OpenSSL/1.0.1e-fips
mod_bwlimited/1.4
mod_perl/2.0.8
Perl/v5.10.1
Sorry for the late answer. Creating custom 404 page is trivial in Apache. >>> Here is good tutorial:
https://www.digitalocean.com/community/tutorials/how-to-create-a-custom-404-page-in-apache
I did all that quite some time ago. Yes, my 404 page does appear when
someone requests a non-existant page.
What I want, however, is to display the path that the visitor requested.
For example, someone might request
http://www.rossde.com/garden/xxyyzz.html
My 404 page already has coded into it
Error at <www.rossde.com>
The next line on the page says
No Such Web Page:
where I would want to see
No Such Web Page: /garden/xxyyzz.html
For that to work, I need the Apache environment variable that contains
the path that was requested.
All this worked with a prior Web host. But that host decided to
eliminate all consumer accounts, focusing only on commercial accounts.
I am very frustrated because my current host does not seem to handle
server-side includes well.
You want the REQUEST_URI environmental variable:
REQUEST_URI: /cgi-bin/environ.pl
From the following perl cgi script:
----snippy------
#!/usr/bin/perl -- -*-perl-*-
print qq(Content-Type: text/html\n\n<HTML>
<HEAD>
<TITLE>Environmental Variables in CGI</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFF0">
);
foreach $key (sort keys %ENV){
print qq(<strong>$key</strong>: $ENV{$key}<br>\n);
}
print "</body>\n";
----snippy------
Which looks like it gives you precisely what you want.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 64:40:47 |
Calls: | 6,488 |
Calls today: | 1 |
Files: | 12,096 |
Messages: | 5,274,799 |