How do I bolt a WordPress blog onto a /blog URL for a PHP Yii site running on Heroku?

I’m thinking of modifying the .htaccess file to create a reverse proxy, or to forward requests in Yii, but I’m not sure. It might be similar to this answer, but for PHP instead of Rails.

How can I use a subdirectory instead of a subdomain?

Read More

Is there a standard Composer plugin for PHP/Yii for setting up a reverse-proxy?

Related posts

1 comment

  1. Procfile

    web: vendor/bin/heroku-php-apache2 -l runtime/logs/app.log -C httpd_include.conf web/
    

    httpd_include.conf

    DirectoryIndex index.php index.html index.htm
    # For blog
    LoadModule proxy_html_module libexec/mod_proxy_html.so
    LoadModule ssl_module libexec/mod_ssl.so
    LoadModule xml2enc_module libexec/mod_xml2enc.so
    SSLProxyEngine on
    ProxyRequests off
    ProxyPass /blog https://shopwiz2.wordpress.com
    ProxyPassReverse /blog https://shopwiz2.wordpress.com
    ProxyHTMLURLMap https://shopwiz2.wordpress.com /blog
    <Location /blog>
      ProxyPassReverse /
      ProxyHTMLEnable On
      ProxyHTMLURLMap / /blog
      RequestHeader    unset  Accept-Encoding
      #LogLevel proxy:debug
    </Location>
    

    Reference:

    http://www.apachetutor.org/admin/reverseproxies

    https://devcenter.heroku.com/articles/custom-php-settings#using-a-custom-application-level-apache-configuration

    https://httpd.apache.org/docs/trunk/mod/mod_proxy.html

Comments are closed.