wordpress permalinks using hhvm

I have ubuntu 14.04, and i have a wordpress blog with hhvm and apache2.

This is my apache2 site config:

Read More
<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/myblog

        ServerName my.blog.com

        ErrorLog ${APACHE_LOG_DIR}/myblog/error.log
        CustomLog ${APACHE_LOG_DIR}/myblog/access.log combined
        ProxyPassMatch ^/(.*.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/myblog/$1
</VirtualHost>

this config will redirect all .php requests to my hhvm server, and the other files (statics) will be served from the DocumentRoot.

How can i enable the wordpress permalinks?
this is the wordpress .htaccess suggested:

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

any idea? thanks

Related posts

Leave a Reply

2 comments

  1. This can be resolved with:

        DocumentRoot /var/www/myblog
        ProxyPassMatch ^/(.*.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/myblog/$1
        ProxyPassMatch ^(?!/wp-admin/)([^.]+)$ fcgi://127.0.0.1:9000/var/www/myblog/index.php
    

    The first rule will serve the assets (images, css, etc)

    The second rule match all .php requests (for no permalinks, like wp-admin/ urls, etc) with the correct .php file (using hhvm)

    The third rule will match with all requests with no extension (aka permalink) (image.jpg, file.css, etc) (using hhvm)

    Note: you will exclude all other no-extension files that you want in the ProxyPassMatch, or put all them in other subdirectory and exclude it.

  2. Had a similar issue and I added this in my nginx conf to make it work for wordpress clean permalink urls (without /index.php/ in the urls) with hhvm 3.21

    location / {
    ...
        rewrite ^/([^.]+)$ /index.php/$1 break;
    ...
    }
    

    Ensure you are using a fastcgi and not a server version (in server version you may get too many redirects due to rewrite)

    • TESTED
    • QA PASSED