How to write h2o webserver mruby handlers for WordPress multisite?

This is what Apache needs. I like to know how I do it in h2o.

RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] 

// lost 300 reputation on this btw.

+8
ruby wordpress mruby
source share
1 answer

Basically, your Apache file is too much for WordPress.

This should do the trick on H2O:

 hosts: "www.example.com": listen: port: 80 paths: "/": file.dir: /path/to/doc-root # serve static files if found redirect: # if not found, internally redirect to /index.php/<path> url: /index.php/ internal: YES status: 307 file.custom-handler: # handle PHP s using php-cgi (FastCGI mode) extension: .php fastcgi.spawn: "PHP_FCGI_CHILDREN=10 exec /usr/bin/php-cgi" access-log: /path/to/the/access-log error-log: /path/to/the/error-log pid-file: /path/to/the/pid-file http2-reprioritize-blocking-assets: ON # performance tuning option 

Hope this helps ...

-one
source share

All Articles