Page 1 of 1
Fallback for failed .htaccess?
Posted: Sun Mar 15, 2009 4:44 pm
by allspiritseve
One of my client's sites is hosted at GoDaddy (their choice, not ours). GoDaddy's mysql server was rejecting all connections, and the site was down for almost 2 hours. I put up a friendly error message, but disabled the .htaccess file so that it wouldn't try to route traffic to the bootstrap file. After they fixed the problem, I enabled the site, and the .htaccess file... and then remembered that GoDaddy's server caches the .htaccess file. I had to wait another hour, hour and a half before it actually recognized the correct version.
This was one of the first sites we used clean urls with, and we have since coded a URL generator that will spit out clean urls if the bootstrap is loaded, and standard urls if not. This seems to be working fine, but is really a pain for sites that have more complex urls. I'd like to make clean urls standard at some point, but that means, for clients who prefer external servers such as GoDaddy, our hands are tied if something happens to the .htaccess file like it did today.
I'm wondering if anyone has any suggestions for how to avoid this. If our whole site has hard-coded urls such as /page1/page2/page3/, and the .htaccess doesn't work, then these urls are going to trigger a 404 error. I suppose we could hijack the error handler, but that would be bad for SEO, because every page would be seen as a 404 error page by search engines. Anyone have any better ideas?
Re: Fallback for failed .htaccess?
Posted: Sun Mar 15, 2009 8:50 pm
by josh
allspiritseve wrote: Anyone have any better ideas?
Give Karl ZImmerman a call @ steadfastnetworks
Re: Fallback for failed .htaccess?
Posted: Sun Mar 15, 2009 8:56 pm
by allspiritseve
josh wrote:allspiritseve wrote: Anyone have any better ideas?
Give Karl Zimmerman a call @ steadfastnetworks
Uh... who's that?
Re: Fallback for failed .htaccess?
Posted: Sun Mar 15, 2009 11:50 pm
by omniuni
Generate your links, instead of hard-coding them. Try a file_get_contents from someplace using a clean link, and if it works, return everything in clean format, else, return the links in regular ?page=blah kind of format.
Possibly more trouble than it's worth.... (just get a host that doesn't cache .htaccess! Gah, I hate GoDaddy. Dealt with this myself just the other night!)
Re: Fallback for failed .htaccess?
Posted: Mon Mar 16, 2009 12:03 am
by allspiritseve
I'd rather not generate the links unless I have to. Most of our clients' sites run off our own server, this is just for the select few who go against our recommendations and use a different host.
Re: Fallback for failed .htaccess?
Posted: Mon Mar 16, 2009 12:12 am
by Benjamin
allspiritseve wrote:I'd rather not generate the links unless I have to. Most of our clients' sites run off our own server, this is just for the select few who go against our recommendations and use a different host.
If the client wants to use their own hosting provider, then I wouldn't support the site. If the environment is out of your control it's their problem.
Re: Fallback for failed .htaccess?
Posted: Mon Mar 16, 2009 12:48 am
by omniuni
Unfortunately, I have to agree with Astions. There is a point where you have to cut your losses and say, "We can not keep dealing with this host. If you want us to continue development, you will need to do it on our own server, like all of our other clients."
They hire you for a reason. If otherwise they are happy with your services, they should trust you enough to follow your suggestion.
Re: Fallback for failed .htaccess?
Posted: Mon Mar 16, 2009 2:31 am
by Benjamin
Yeah. On the other hand if you are billing them hourly to fix problems caused by their host I guess you aren't doing too badly.
Re: Fallback for failed .htaccess?
Posted: Mon Mar 16, 2009 4:09 am
by josh
allspiritseve wrote:Uh... who's that?
The owner of the company. He helped me on Xmas eve in thru the a.m. when my old company tanked. He's the cheapest on the net and offers shared / VPS all the way up to dedis and colo. There's no 3rd party bullcrap scripts that obstruct you on his servers.
Re: Fallback for failed .htaccess?
Posted: Mon Mar 16, 2009 9:46 am
by allspiritseve
josh wrote:allspiritseve wrote:Uh... who's that?
The owner of the company. He helped me on Xmas eve in thru the a.m. when my old company tanked. He's the cheapest on the net and offers shared / VPS all the way up to dedis and colo. There's no 3rd party bullcrap scripts that obstruct you on his servers.
Ah... thanks for the recommendation, but we have our own server. This is just for the rogue client who thinks they're getting a better deal by hosting at GoDaddy or whatever. We've had so many problems with .htaccess that I'd love to have a way to easily switch our codebase to emulate clean urls without .htaccess. That way, we don't have problems later on (like it or not, some clients want a cheap host, and we just can't afford to leave them completely in the dust.)
Re: Fallback for failed .htaccess?
Posted: Mon Mar 16, 2009 3:32 pm
by Benjamin
Here's how I look at it. Even if you have only spent 20 hours over the course of the last 12 months fixing issues on their site because of the server, assuming you charge $45 per hour, the added cost of the "cheap" hosting is now $900 + whatever they already pay.
Re: Fallback for failed .htaccess?
Posted: Mon Mar 16, 2009 5:14 pm
by omniuni
Astions, sometimes you just can't convince a client of things like that. They'd rather pay you double, than pay the host.
