Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using .htaccess with FastCGI

I've readed that when using FastCGI to run PHP the .htaccess file included into the main directory of my site is ignored (right now i have the .htaccess file located in /var/www/vhosts/mydomain.com/httpdocs) My question is how can i apply the directives and flags currently on .htaccess to this domain only? can i have an httpd.conf only for this domain? where should i put the current .htaccess content to keep the same settings working?

many thanks in advance,

like image 930
FidoBoy Avatar asked Nov 07 '10 11:11

FidoBoy


1 Answers

Apache will read .htaccess files as long as AllowOverride is enabled in httpd.conf. What you cannot do is put PHP directives inside .htaccess: this works only with PHP installed as an Apache module and would cause a 500 Server error with PHP installed as either CGI or FastCGI.

Some configurations (with suphp and similar) allow for a per-directory php.ini with local settings. If this doesn't work with your setup you can change php.ini settings only with a series of ini_set() instructions (in an included file, most often)

like image 167
djn Avatar answered Oct 02 '22 08:10

djn