I needed slim php to work with pretty urls using .htaccess
, well no problem.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
Now I ran this using hhvm, fastcgi using this virtual host config.
<VirtualHost *:80>
ServerName project.dev
ServerALias www.project.dev
DocumentRoot /var/www/project
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/$1
<Directory "/var/www/project">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Of course, it won't read the .htaccess file, I thought of adding the .htaccess
config in virtual host config, but no, it won't work.
Like so:
<VirtualHost *:80>
ServerName project.dev
ServerALias www.project.dev
DocumentRoot /var/www/project
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/project/$1
<Directory "/var/www/project">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
</VirtualHost>
This isn't really an HHVM issue, more trying to do rewriting at the same time as proxying.
Doing a quick google search yields another answer which might help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With