Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having a bit of trouble with my current web host. Here's a bit of a long story, when I'm looking for a short answer.

Currently if someone enters an invalid URL that contains %2F the server shows a 404 error page, and from my research so far the error page that is shown is the default error page, which is specified in the httpd.conf file.

I was reading that for this type of error the server throws a 404 before any domain specific rules are read, therefore this specific error page cannot be customized in my .htaccess file.

My problem is that my current host had placed some advertising code on the default error page, when I don't believe they should have. And reading their domain registration agreement it doesn't sound like they should have ads on this page anyways.

They say that they will place ads on your 404 error pages if you do not specify a custom error page, and if the "do not place ads on my non-custom error pages" is not set. They say that by not setting up custom error pages you authorize them to place these ads.

However, I DO have custom error pages set, and I have disabled the ads for "non-custom error pages" in the control panel. So based on this information I do not believe ads should be shown on the error page in question, because it cannot be customized, and the ads cannot be disabled, therefore according to their agreement I have not authorized the placement of these ads.

So I contacted tech support to see about getting the ads removed from the DEFAULT error page that is shown when errors, such as the %2F error, are shown. Ads would still be shown on the 404 error pages for users who fail to set their own custom error pages, or do not disable the ads. They seem eager to help, and they agree that the ads do not look very good.

However, the level of tech support seems to be about the same as you would expect to find in elementary school. No matter how many times I explain the problem, and exactly how to fix it, they come back explaining how they did one thing or another, and the issue should be "solved". Needless to say it is not solved, because as I've explained to them numerous times nothing they do in my .htaccess file will address this problem.

So I am wondering, is there any possible way that I can find the exact location of the Apache httpd.conf file through PHP/Perl? Or better still, the exact location of the default 404 error page? At least if I know where the file was I could give them even more specific instructions on how to fix this.

I never would have thought that explaining how to find the default error page for Apache would have been so hard, especially when explaining it to a hosting provider.

share|improve this question
I have the entire conversation between us saved, it is actually quite unbelievable, lol. – Sherwin Flight Aug 14 '12 at 6:40
Interesting situaiton, maybe this will help if it works with your hosting provider -- redips.net/php/find-files-with-php – Chida Aug 14 '12 at 6:45
I don't think a script will be able to access the folders where the config files are due to security restrictions. I was hoping that there would be some sort of environment variable or something that would say the location of the default error page or something. Not really sure about that though, so figured I'd ask. – Sherwin Flight Aug 14 '12 at 6:47
And just checked, about 50 messages between the host and myself so far, and they still can't figure out how to find the default error page, haha. The thing is, I've already explained it all to them, several times already. I'm actually amazed that there is tech support this bad. Started off talking to customer support, then was escalated to the 'Technical Specialist' team, and am now on 'Level 3 Tech Support', and even they have no idea what's going on. – Sherwin Flight Aug 14 '12 at 6:51
The answer, of course, is to switch to another hosting provider which didn't outsource their tech support to Outer Mongolia. – Michael Hampton Aug 14 '12 at 6:54
show 8 more comments

closed as too localized by Michael Hampton, Ward, Iain Aug 14 '12 at 7:16

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.