Trying to help someone who is hosted with yahoo
vkaryl
Status: Contributor
Joined: 31 Oct 2004
Posts: 273
Location: back of beyond - s. UT, closer to Vegas than SLC
Reply Quote
(in other words, no .htaccess), has wp installed, and is trying to use a custom 404 page below the root folder.

Is there some setting in php.ini which can be made to force the 400 page display instead of turning up a 500 internal server error?
Back to top
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 3905
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
If they don't have .htaccess support, they definitely aren't going to have php.ini access.

The question
Normally in php you can emulate the behavior of some of the server header stuff from .htaccess, but that requires that the page is setup that is going to be accessed. For example, you can setup a 301 from an existing php page/file to another one.

But, as you can probably see by now, you can't setup something for something that doesn't exist, namely a custom 404, since that header would only come into play if it did exist. In other words, we tend to use a 404 page missing page for all pages that DO NOT EXIST. The only way to emulate a 404 with php is to create ALL PAGES THAT DO NOT EXIST and then put the php location header script on them. Obviously not possible...

Keep in mind the process though, Apache gets the request for a url, it decides what to do with it. If nothing stops it, it looks for it where it's supposed to be in the filesystem. If that page doesn't exist, it gives the 404 default error page unless Apache has been given a different error page. This happens on the server level, php is below that level, though any single php file can emulate this behavior, usually with 301/302s.

One solution
If there is a specific page you want to receive a 404, just make that page a file, and make that file only contain the 404 header php.

:: Code ::
<?php
header("HTTP/1.0 404 Not Found");
// send it to some other page, this may cause problems with search engines.
header("Location: /custom-error-page.html");
?>
from php.net

A better solution
Other than that, yahoo hosting.... not for serious consumption, is the headache really worth saving that 7.95 media temple hosting fee?... ahhh, mod alert, I've recommended a specific hosting company, somebody make me stop...

But wait, I just read the TOS, I can in fact recommend them, we've used them, other people I know have used them, they don't suck as bad as most cheapo hosters. Emphasis on the 'as bad'. Not top level, but for mysql + full .htaccess/mod_rewrite support, these guys aren't bad. Uptime is decent. Wouldn't use them myself, but I'm spoiled.

Re hosting, I've been forced over the past year to use a ridiculous number of lame hosting, and to deal with even more. My conclusion, as always, is simple: there is no such thing as 'free hosting'. You always pay, in one way or another.

There is no such thing as $3-5 a month hosting, you always pay, in one way or another.

Mediatemple is one of the few relatively cheapo hosting companies I've tried that are reasonably headache free, good uptime, well regarded, you know the drill... blah blah.. no they don't pay me, I don't even like them personally, but they do work, and they charge the lowest possible price to provide working hosting you can charge while actually supporting the stuff you say you support.

An even better solution
But here's the real secret: get 5 sites together, or a few sites and a few friends, get a single $17.99 a month pair account, add as many sites as you need to it for $1 a month, assuming all mysql driven, 5 sites for about $20 a month if you prepay, that's $4 a month per site. That's the real deal, best hosting in the USA, probably the world for almost nothing per site.
Back to top
vkaryl
Status: Contributor
Joined: 31 Oct 2004
Posts: 273
Location: back of beyond - s. UT, closer to Vegas than SLC
Reply Quote
I had a feeling.... I sort of "gently" inquired as to why she didn't want to dump yahoo, and of course it's the same thing with me a lot: don't want to mess with the server changeover.

Well, I told her the bad news. That's all I can do for her - if she asks me about hosting, I'll give her your thoughts.

Thanks so much - I do appreciate you letting me pick your brain!
Back to top
Display posts from previous:   

All times are GMT - 8 Hours