Joey Hipolito
Joey Hipolito

Reputation: 3166

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>

Upvotes: 14

Views: 1525

Answers (1)

Paul Tarjan
Paul Tarjan

Reputation: 50652

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.

Upvotes: 1

Related Questions