I got 2 sites:

http://wp.example.com and http://app.example.com

The main site will be the Wordpress install, but we have a custom e-commerce app on the other domain/ip. What im trying to achieve is that the clients see the billing platform as if it was part of the wp site.

As you know, Wordpress (in wp. site) needs mod_rewrite which just points it all too /index.php.

So my question is how can I add an exception so that http://wp.example.com/mapped/link just proxies the request to http://app.example.com/actual/link?

Here's what I've tried:

  • Add Exception to mod_rewrite rules in .htaccess
  • Add Location entry to sites-available config file to setup ProxyPass

WordPress .htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !/mapped/link [NC] # Exclude /mapped/link from mod_rewrite filter
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Bit of sites-available of WordPress install

<Location /mapped/link>
ProxyPass http://app.example.com/actual/link 
ProxyPassReverse http://app.example.com/actual/link
Order allow,deny
Allow from all

<Directory /var/www/wordpress>
Require all granted
# Allow local .htaccess to override Apache configuration settings
AllowOverride all

With this setup I just get 404 page from apache (not the fancy 404 from my Wordpress theme so that's progress), for some reason URL never gets proxied. Thanks in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.