Custom 404 error page

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Custom 404 error page

Post by jaoudestudios »

Jordi wrote:ok, but neither one of the two error.php files seems to be called when a page is not found. you can test it at http://www.catalansoft.com and adding to this urs whatever file name you can think of. the browser's url text box starts to go mad until it is manually stopped.
I added to the url and it just redirected me back to the homepage.

NB: frames are very bad if you want to be listed in google!
Last edited by jaoudestudios on Wed Jan 14, 2009 10:56 am, edited 1 time in total.
Jordi
Forum Newbie
Posts: 20
Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain

Re: Custom 404 error page

Post by Jordi »

You're right. There was an error in the php file. Some double quotes now changed to single quotes.
.. but a non-existing page still not showing it :?
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Custom 404 error page

Post by jaoudestudios »

And you are putting your .htaccess file in the root of your website? Which will be along side your index.php file.

Because what is strange is, if I append to your url it just redirects me to the home page.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Custom 404 error page

Post by jaoudestudios »

Ahh, you are using frames! and your inner frame is remote, right? Just checked, they must be as they have different IPs. Which server are you uploading the .htaccess file to? To be honest I have never used frames, so I am unaware of their limitations - I just know they are very bad for indexing by google.

I tried this url http://www.catalansoft.com/nopage.php and I get this source code...

Code: Select all

 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Catalan Soft</title>
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</head>
    <frameset frameborder="0" framespacing="0" border="0" rows="100%,*">
        <frame name="MYTOPFRAME" src="http://jordiserres.homeip.net/nopage.php" noresize>
        <noframes>
            <body>
           <h1>Catalan Soft</h1>
           <br>
       <br>
       <br>
       Click here to enter <a href="http://jordiserres.homeip.net/nopage.php">http://jordiserres.homeip.net/nopage.php</a>
           <hr>
| Domain Name Registration and Domain Name Forwarding by <a href="http://www.mydomain.com">mydomain.com - Register your domain name</a>
        </body>
        </noframes>
    </frameset>
 
</html>
 
 
 
Jordi
Forum Newbie
Posts: 20
Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain

Re: Custom 404 error page

Post by Jordi »

No, I'm not using them.
The code you posted is the one at the server hosting my domain, which redirects to my server at home, where there are no frames at all.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Custom 404 error page

Post by jaoudestudios »

Jordi wrote:No, I'm not using them.
The code you posted is the one at the server hosting my domain, which redirects to my server at home, where there are no frames at all.
Just to clarify....
This is the domain I should be looking at/testing on...http://jordiserres.homeip.net/flightschool/? (continuously redirects)
Not http://www.catalansoft.com? (because this does not redirect it calls in using frames) (redirects to homepage - I think due to frames)
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Custom 404 error page

Post by jaoudestudios »

Jordi wrote:

Code: Select all

 
ErrorDocument 404 http://jordiserres.homeip.net/flightsch ... .php?e=404
 
Try removing the ?e=404 and see if that makes a difference.

The infinite loop keeps appending the url with the folder name (/flightschool), so I think it is working (i.e. your server is setup to use .htaccess files) but something little is not right.
Jordi
Forum Newbie
Posts: 20
Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain

Re: Custom 404 error page

Post by Jordi »

Just to clarify....
This is the domain I should be looking at/testing on...http://jordiserres.homeip.net/flightschool/? (continuously redirects)
Not http://www.catalansoft.com? (because this does not redirect it calls in using frames) (redirects to homepage - I think due to frames)
You'll see that both addresses eventually lead to the same landing page. That's o.k.
The first one is the 'real' address, of my home-located server. The second one is the 'public' address, which is hosted at http://www.mydomain.com, which redirects to my home server.
Try removing the ?e=404 and see if that makes a difference.
I tried it, and makes no difference.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Custom 404 error page

Post by jaoudestudios »

What OS is your server running?
Jordi
Forum Newbie
Posts: 20
Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain

Re: Custom 404 error page

Post by Jordi »

My server is running linux, using Apache and MySql
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Custom 404 error page

Post by jaoudestudios »

Jordi wrote:My server is running linux, using Apache and MySql
ok, good :) , just checking. For a moment I had a bad feeling you were running a windows server.

Time to dive a little deeper. I will compare your httpd.conf file to mine and let you know.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Custom 404 error page

Post by jaoudestudios »

Where are your files located on your linux server? (eg /var/www/....)
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Custom 404 error page

Post by Eran »

Does the .htaccess file in the script directory has the proper AllowOverride settings? (AllowOverride All)
http://httpd.apache.org/docs/2.0/custom-error.html
Jordi
Forum Newbie
Posts: 20
Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain

Re: Custom 404 error page

Post by Jordi »

var/www/flightschool is the main folder, where .htaccess, index.php, and error.php are.
there are four folders which classify different file contents: code, css, images and miscellaneous files.
Jordi
Forum Newbie
Posts: 20
Joined: Wed Jan 14, 2009 8:37 am
Location: Barcelona, Spain

Re: Custom 404 error page

Post by Jordi »

Settings for this file are (octal) 644, if that's what you mean
Post Reply