Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working with pretty urls on apache and fastcgi after hhvm installation

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>
like image 793
Joey Hipolito Avatar asked Jun 20 '14 02:06

Joey Hipolito


1 Answers

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.

like image 110
Paul Tarjan Avatar answered Oct 12 '22 12:10

Paul Tarjan