Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
koberulz is on a distinguished road
 
Posts: 25
Join Date: Sep 2010
Default 404 Pages In Wrong Location? - 09-29-2010, 06:00 AM

Occasionally, the 404 error page I've created will show up, but the URL in the address bar will remain that of the page that was not found. Due to this usually being in a subfolder, this ruins the display of the page and results in the links on the 404 page returning 404 errors, since everything's up one folder. Is there a way to fix that?
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
d3iti's Avatar
Super Moderator
d3iti is on a distinguished road
 
Posts: 4,609
Join Date: Jul 2009
Location: Spain
Default 09-29-2010, 08:35 AM

Hi koberulz,

I am also interested in the subject, but the normal response on the servers that I know is to keep the invalid address in the address bar of your browser.

Do you know web page where happens what you're looking for?


Si este mensaje te ha servido de ayuda no dudes en pulsar sobre el botón karma
Reply With Quote
(#4 (permalink))
Old
Junior Member
koberulz is on a distinguished road
 
Posts: 25
Join Date: Sep 2010
Default 09-29-2010, 12:30 PM

http://koberulz.webege.com/Blog/2010/24012010.php

It used to redirect to http://koberulz.webege.com/Errors/404notfound.php, which allowed the links to work, but now it doesn't. I've changed the links so that they work for now, though. This started happening about the same time as the 404 error started showing up on a page that actually existed (which I also have a thread about), though that 404 page actually works properly.
Reply With Quote
(#5 (permalink))
Old
willypt's Avatar
Senior Member
willypt is on a distinguished road
 
Posts: 703
Join Date: Jul 2010
Location: Jakarta, Indonesia
Send a message via MSN to willypt
Default 09-29-2010, 12:37 PM

When I try to connect to your site, why a modem login box popped-up? Do you use your home IP as a webserver? If so, you have to configure your modem to match your in and out port and LAN IP


Need assistance in installing your script? Why don't ask http://free-installations.info/
Reply With Quote
(#6 (permalink))
Old
Junior Member
koberulz is on a distinguished road
 
Posts: 25
Join Date: Sep 2010
Default 09-29-2010, 12:58 PM

I've no idea what any of that even means. I created an account, and used FileZilla to upload a few .php files. Nothing complicated.
Reply With Quote
(#7 (permalink))
Old
drums's Avatar
Senior Member
drums is on a distinguished road
 
Posts: 579
Join Date: Aug 2010
Location: Oz
Default 09-30-2010, 02:43 AM

Hi koberulz,

The reason you're getting a problem is that your CSS reference is using a relative url (ie: ../css/main.css)

There are a couple of solutions to your "broken" error pages

1) is if you wish to use relative URLs, then add some html to your page to force a particular base URL as follows:

Code:
<base href="http://koberulz.webege.com/Blog/" />
2) Don't use any relative URLs.

drums
Reply With Quote
(#8 (permalink))
Old
Junior Member
koberulz is on a distinguished road
 
Posts: 25
Join Date: Sep 2010
Default 09-30-2010, 05:59 AM

I understand that it's broken because of the relative URLs, but it was working before, which is the issue. The URL in the address bar was always koberulz.webege.com/Errors/404notfound.php, rather than whatever had been typed in to produce the 404 error.

If the URL of the missing page is meant to stay in the address bar, I guess I'll go through and remove all the relativity then.
Reply With Quote
(#9 (permalink))
Old
drums's Avatar
Senior Member
drums is on a distinguished road
 
Posts: 579
Join Date: Aug 2010
Location: Oz
Default 09-30-2010, 07:44 AM

Hi Koberulz,

The correct way for Errordocuments to work is to leave the URL as the incorrectly entered URL and set the 404 status in the HTTP header.

This allows spiders/robots to recognise that the URL being shown is incorrect and not a correct URL which is redirecting to a broken URL (which is what would change the address bar in the browser).

Having said that, you'll still need to resolve your relative URL issue. If you have lots of relative URLs, the the quickest way is definitely to add the base directive that I mentioned earlier, as you only need to do it once in your html doc.

drums
Reply With Quote
(#10 (permalink))
Old
Junior Member
koberulz is on a distinguished road
 
Posts: 25
Join Date: Sep 2010
Default 09-30-2010, 10:32 AM

If someone gets a 404 error elsewhere (for example the Updates page that is returning the 404 error my other thread explains), however, the base directive will screw up that error page, will it not?

It's only one or two links per page, it's not too big a deal. It's just that as I said, it was displaying the 404 page's URL before, so the links worked.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com