Question

I have DocumentRoot /var/www/test in my .htaccess file. This is causing the apache server to give me a 500 internal server error.

The error log file shows: alert] [client 127.0.0.1] /var/www/.htaccess: DocumentRoot not allowed here

AllowOveride All is set in my conf file.

Any idea why this is happening?

Was it helpful?

Solution

The DocumentRoot directive cannot appear in a .htaccess file. Put it in httpd.conf instead.

OTHER TIPS

DocumentRoot should be set in your VirtualHost directive, not your .htaccess file.

Any specific reason you put DocumentRoot in your .htaccess file?

You don't mention your apache version , but docs for 2.0 say that DocumentRoot is only valid for virtualhost or server config. Acording to the docs it should not be used in a .htacces

http://httpd.apache.org/docs/2.0/mod/core.html#documentroot

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top