Welcome to Geeklog, Anonymous Tuesday, April 16 2024 @ 04:57 pm EDT

Geeklog Forums

Editing 404.php?


julianna

Anonymous
Hi.

Right now, my 404.php shows the following:

----------

Not Found
The requested URL /justmetesting404.html was not found on this server.

Apache/1.3.20 Server at www.transient waters.net Port 80

-----------

How do I edit either the 404.php or lib-common.php file to add a hyper-link to my main page? I'm asking because I had my website configured to automatically redirect to the main page, but search engines continue to list obsolete files because they're not hitting a 404 message. However, I want persons to be able to visit my site by simply clicking on a link.

Thanks!

p.s. There isn't actually a space between "transient" and "waters", but it otherwise looks like transien*censored*ers on this board
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
What you need to do is tell the Apache webserver to use Geeklog's 404.php instead of its own standard 404 page (which is what you're seeing at the moment).

To do this, create a file named .htaccess (note the leading dot) in the directory where the 404.php is and enter this as the content of the file:
Text Formatted Code
ErrorDocument 404 /404.php
 
This assumes your Geeklog site is installed in the document root, i.e. that you could call up 404.php with the url http://www.example.com/404.php - you'll have to adjust the link to 404.php accordingly if it is somewhere else.

bye, Dirk
 Quote

Status: offline

Xmystic

Forum User
Newbie
Registered: 09/25/05
Posts: 7
I get:

404 Error
Gee, I've looked everywhere but I can not find http://www.thecableking.com/404.php.

We're sorry, but the file you have requested does not exist. Please feel free to check the main page or the search page to see if you can find what you lost.


Shouldn't the page be the one they tried to access?

And if I put a bogus php page in, I get a blank screen with "No input file" error.
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
try to do it as it says aqui but it does not work to me.

my geeklog this in the directory /var/www/html/elsitio/public_html now the .htaccess I have I put in the directory "public_html" or "elsitio"? Rolling Eyes

Saludos !! Mr. Green
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
some aid? praying it will work
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

julianna

Anonymous
1. Check your path/to/geeklog/public_html folder for a file named ".htaccess". If it does not exist, create the file (do not put anything in front of the period).
2. Add the following to the ".htaccess" file:
Text Formatted Code
ErrorDocument 404 /404.php
 

3. In the language file (in path/to/geeklog/language), edit the following:
Text Formatted Code
# 404.php

$LANG_404 = array(
    1 => '404 Error',
    2 => 'Gee, I've looked everywhere but I can not find <b>%s</b>.',
    3 => "<p>We're sorry, but the file you have requested does not exist. Please feel free to check the <a href="{$_CONF['site_url']}">main page</a> or the <a href="{$_CONF['site_url']}/search.php">search page</a> to see if you can find what you lost."
);
 

1 is the title, 2 is the first line, and 3 is the second line:
404 Error
Gee, I've looked everywhere but I can not find http://www.geeklog.net/fakefile.php.

We're sorry, but the file you have requested does not exist. Please feel free to check the main page or the search page to see if you can find what you lost.
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
(do not put anything in front of the period).

it excuses, but I do not understand this part !! Rolling Eyes me can explain ?
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
asi I did it and it shows this to me ...

Text Formatted Code
Not Found
The requested URL /public_html/verde was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
 


Banging your head
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

julianna

Anonymous
Regarding the ".htaccess" file:

In your path/to/geeklog/public_html folder, you should have [among other files] files named "index.php" and "lib-common.php". In the same folder, you will need a file named ".htaccess". Normally, what is after the "." (for example, "php") is the extension, and what before the "." (for example, "index" or "lib-common") is the file name. for the ".htaccess" file, you essentially have an extension of "htaccess" and no file name.

If this file does not already exist, you will need to create it. In the file, you will need to add the following line:

Text Formatted Code
ErrorDocument 404 /404.php
 


After adding this code, try to go to a file which does not exist (for example, http://koalasoft.homelinux.net/public_html/testing404.php). If you have done the above correctly, you should get the following:

404 Error
Gee, I've looked everywhere but I can not find http://www.geeklog.net/fakefile.php.

We're sorry, but the file you have requested does not exist. Please feel free to check the main page or the search page to see if you can find what you lost.


Try this first and report back. If you are able to get this to work, we will move to the next step.
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
I create I file .htaccess within my /path/misite/public_html in where this my lib-commond.php, user.php, etc and between a the example that put:
(for example, http://koalasoft.homelinux.net/public_html/testing404.php)


if I did it and he sends east message to me:

Not Found

The requested URL /public_html/testing404.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Rolling Eyes
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

julianna

Anonymous
Does the ".htaccess" file have the following text in it?

Text Formatted Code

ErrorDocument 404 /404.php

 
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
yes yes ...

this is contend the my .htaccess

ErrorDocument 404 /404.php


and this in my directory /var/www/html/misitio/public_html/.htaccess

and and this it is the message that shows Rolling Eyes
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

julianna

Anonymous
Try moving the ".htaccess" file to /var/www/html/misitio/
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
not Sad
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Since you have public_html in your URL, it must also be part of the URL for the 404.php:
Text Formatted Code
ErrorDocument 404 /public_html/404.php
 

bye, Dirk
 Quote

Status: offline

koalasoft

Forum User
Full Member
Registered: 03/09/05
Posts: 242
Location:Mexico
excellent dirk, thank you very much I work Big Celebration
**Cuando el Alumno esta listo, el Maestro Aparece **
::Geeklog support in Spanish::
 Quote

All times are EDT. The time is now 04:57 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content