Free Web Hosting Forum
(#1 (permalink))
Old
Junior Member
Frans is on a distinguished road
 
Posts: 4
Join Date: Jan 2012
Default avoid 404 redirect - 01-16-2012, 06:56 AM

Hi,

I want to avoid redirection of 404 errors.
I have searched around, but I could not find how to achieve this.
I have found how I can redirect to a different page, but I want no redirect at all, just the error.

My .htaccess is the default one and does not contain any redirection instruction.

Is there a way to achieve what I want to ?

Thanks alot! Frans
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
ShocK's Avatar
Senior Member
ShocK is on a distinguished road
 
Posts: 1,622
Join Date: Jul 2011
Location: UK
Default 01-16-2012, 07:12 AM

hi, do you mean something like this? No redirect just custom made error message - [Tutorial] Custom error pages
Reply With Quote
(#3 (permalink))
Old
nevermore93's Avatar
Senior Member
nevermore93 is on a distinguished road
 
Posts: 234
Join Date: Dec 2011
Location: USA
Default 01-16-2012, 07:18 AM

If you want to display a simple error page, then you will need to create a page with the text you want to display on the error and then direct it properly in the .htaccess file. The servers here default to the 000webhost front page unless you set up your own error page.
Reply With Quote
(#4 (permalink))
Old
Junior Member
Frans is on a distinguished road
 
Posts: 4
Join Date: Jan 2012
Default 01-16-2012, 07:57 AM

Thanks alot for your quick replies!

I already saw those solutions, but I do not want an error page at all, but instead want the browser to get the standard 404 message.

I'm wondering if an ErrorDocument line pointing to a non existing page will work. Can't try that now, but will do that later today.

Still open to other suggestions.

Frans
Reply With Quote
(#5 (permalink))
Old
nevermore93's Avatar
Senior Member
nevermore93 is on a distinguished road
 
Posts: 234
Join Date: Dec 2011
Location: USA
Default 01-16-2012, 08:29 AM

Not sure what exactly you are trying to accomplish, but it seems to be the hard way of going about it and I'm not sure why you would want to do it that way.

Even the standard 404 error message is a generated HTML page. Just create your own with whatever you want the error to say, direct it in the htaccess and call it done.
Reply With Quote
(#6 (permalink))
Old
Junior Member
Frans is on a distinguished road
 
Posts: 4
Join Date: Jan 2012
Default 01-16-2012, 09:27 AM

nevermore93: thanks a lot for your help.
It triggered me to dive further.

I ran a wireshark log.
On other websites when a page is not there I get a
HTTP/1.1 404 Not found
as status (and then indeed the 404 page).

With the default redirect, if a page is not there the user does not get a 404, but instead a redirect:

HTTP/1.1 302 Found
Followed by a redirect to error404.000webhost.com

What I want to achieve is that the user still gets this 404 status and not a 302. It might be that doing my own error page will give me the 404 and no 302. If so, I'm fine.

Best regards, Frans.
Reply With Quote
(#7 (permalink))
Old
Junior Member
Frans is on a distinguished road
 
Posts: 4
Join Date: Jan 2012
Default Fixed - 01-17-2012, 07:00 AM

A small update.

After adding my own 404 catch page with ErrorDocument in .htaccess, the server returns my page with a 404 code (instead of the 302 code I get with the default error page.

Frans
Reply With Quote
(#8 (permalink))
Old
nevermore93's Avatar
Senior Member
nevermore93 is on a distinguished road
 
Posts: 234
Join Date: Dec 2011
Location: USA
Default 01-17-2012, 02:58 PM

As it should ;-)
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