02.12.07

Posted in Quick Guides at 12:27 am by jasonb

Because I enjoy deep hurting, I thought it would be fun to reverse proxy Apache 1.3 using Apache 2.2 with Wordpress 2.1 hosted under the former. With Wordpress 2.1, the rewrite rules generated for the date schema are considerably shorter, but still require a few minor changes to proxy happily.

DocumentRoot /srv/web/blog
 
ProxyRequests On
RewriteEngine On
 
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://blog.example.com:888/index.php$1 [P,L]
RewriteRule ^(.*)$ http://blog.example.com:888$1 [P,L]

Simply, if the requested URI does not match a file or directory located on the filesystem under the configured document root, let Wordpress’ index.php handle the request. Otherwise, the request is proxied through as the file in question actually exists.

Of course, you’ll need mod_rewrite and mod_proxy enabled. mod_proxy has proxy_connect and proxy_http as dependencies, too.

1 Comment »

  1. smk said,

    February 9, 2008 at 9:34 pm

    it’s not working for me.
    i have an infinite loop for index.php requests.

    I think i have a different situation here, anyway. I have apache 1.3 with vhost a.com:80 and apache 2.x with wordpress with vhost real.a.com:8080. The problem is that wordpress is redirecting from index.php if i reach the site with another hostname.

Leave a Comment

Your blog, no spam: the Atlantean, strong, and mighty WP-Hashcash?