Forum Moderators: phranque

Message Too Old, No Replies

RewriteEngine and Options not allowed

worked, then stopped

         

smallcompany

6:11 pm on Mar 20, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have a plan that is tailored for one site (domain), but can have additional where config file gets modified through control panel, but additioanl manual configurations are required if you want separate log files, etc.

Anyway, all worked, but then all additional domains started getting 500.

RewriteEngine and Options not allowed were errors.

I got it fixed with the help of support folks, by changing AllowOverride from "AutoConfig" to "All" under "drirectory" section.

It worked.

But, why I haven't had 500 at the first place?

I see there is another entry AllowOverride which was already set to "all"

I guess I'll have to configure PHP file that emails me about 500 just like I have it for 404s.
I wonder if that will work like with 404.

smallcompany

9:38 pm on Mar 20, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I posted this too quick.

Whys and buts will probably get no answer as nobody knows why it would work and then require additional modification in the config file.

Anyway, if I could get informed about 500, that would be great.

I tried the concept I use for 404 and 403, but since 500 in this case would not even read the .htaccess as very first entries would get denied, how do I configure custom 500 page so I get an email when it gets triggered? Is it in the config file?

Thanks

jdMorgan

10:49 pm on Mar 20, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Put the "send me an e-mail" set-up into a script called from the main server configuration file.

The control panel is likely 'creating' new VirtualHosts with most Options disabled, and no 'privileges' under "AllowOverride" to allow Options to be set at the .htaccess level (Look up the AllowOverride and Options directives, and read the documentation thoroughly). If this is that case, then I would suggest that your current hosting plan is not sufficient to your needs, and you may want to look into a basic "hosting reseller" account, where all of this stuff is handled properly. (I don't do hosting myself, so that's all I know.)

Jim

smallcompany

4:01 am on Mar 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Put the "send me an e-mail" set-up into a script called from the main server configuration file.


Uh. How do I call PHP script (or HTML with PHP in it) from httpd.conf file?

I see a line that says:

#ErrorDocument 402 http://www.example.com/subscription_info.html

Would this work:

ErrorDocument 500 http://www.example.com/script.php

Or that would again get stopped if .htaccess did not work like in my case?

Then, there is this:

# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var

Would this work if I enable it and direct it to PHP script?

Also, if I enter ServerAdmin line into my additional virtual server(s), would that fire an email on 500 error?

Thanks

g1smd

8:09 am on Mar 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



ErrorDocument directives should point to local paths (i.e. without protocol and domain name) otherwise they return a 302 response instead of the correct status.

jdMorgan

2:06 pm on Mar 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would suggest that testing the proposed ErrorDocument solution would be faster than waiting for "opinions" to be posted here, and give a direct answer to your question.

Whether it works will depend on whether the error-handling script that you use has dependencies that also trigger the 500 error. If that is the case, then one 500 error will trigger another, and then another, etc. as your server tries to execute this error-handling script, gets another error and so tries to execute this error-handling script, gets another error, etc.

Therefore, the error-handling script should be kept as simple as possible in order to minimize external dependencies (and this is always true of error handling scripts in general).

Jim

smallcompany

3:50 pm on Mar 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



ErrorDocument directives should point to local paths


I used examples as they were in the httpd.conf file. In my .htaccess, I use local paths, but that does not help if .htaccess does not work as it did not in this particular case.

I'll see how it goes when I set custom 500 in the httpd.conf within the settings of a particular virtual host.
Now at least I know how to trigger this 500 by changing AllowOverride.

jdMorgan

4:37 pm on Mar 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> I used examples as they were in the httpd.conf file.

These need to be fixed wherever they occur and whoever wrote them, or your rankings may suffer because their syntax is incorrect and --as documented-- will result in a 302-Found redirect, not a 404-Not Found error response. g1smd may have saved you hours or days of time and/or thousands of dollars in lost revenue or SEO consulting fees simply by pointing that out.

Jim

g1smd

5:06 pm on Mar 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Where do I send the bill? :)

That's about the tenth time I have stumbled over that problem so far this month!

smallcompany

8:03 pm on Mar 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



g1smd may have saved you hours or days


I never used that. I just quoted what I found in config file and wondered about it as it was in multiple places (sections).

I only used custom error page configurations in .htaccess and always used local paths.

The example.com made me wonder about internal thing going out and coming back.

Sorry if I went too wide. I was really about specific problem when .htaccess does not get read and therefore 500 custom page/script does not get loaded.
The whole story was how to get around .htaccess. I'll test stuff directly within the config file on the virtual host level.

Thanks