Reverse Proxy and Permalinks
-
Hello
I’ve been using WordPress behind a ReverseProxy for a while. It works pretty Ok after modifying the base URL in the database and disabling the CanonicalURL function in the sourcecode. However, I can’t seem to get Permalinks to work.
The setup is like this:
independence.mydomain.com/blog/ is passed via the proxy into the backend server which recieves a request like this: mydomain.com:8080/~independence/blog/If I enable Permalinks in WordPress, it writes a .htaccess file like this:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule> # END WordPress
This does not work on my setup since /blog/ is not in the root, but actually in /~independence/blog/, so I rewrote it like this:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /~independence/blog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /~independence/blog/index.php [L] </IfModule> # END WordPress
Now the rewrite seems to work fine, but WordPress can’t figure out which pages to load. I just get messages like “This page does not exist” instead of the actual content on any page. The menu/sidebar etc loads fine however.
I’ve been looking around a bit in the sourcecode, wp-includes/rewrite.php for example, but I can’t find the place where the interpretation of the URL is done. Has anyone else got this working?
- The topic ‘Reverse Proxy and Permalinks’ is closed to new replies.