Proxy configuration

Hey guys, I was referred to this forum to post a problem I’m having. Here’s an issue I have. We have customers that need to access a short domain as well as the FQDN; but proxied to another remote server where content is still present.

So: www.mydomain.com and also mydomain.com needs to be proxied to another remote IIS Web Server.

Here is my rule:

ProxyPass /classes http://www.myolddomain.com/classes

So when I go www.mydomain.com/classes its proxied from http://www.mynewdomain.com/classes

Using the FQDN works, using the short name redirects to the home page. I tried the following rule combination with no luck. I am not a RW/Proxy guru. Where could my rule be going wrong?

RewriteCond %{http_host} ^mydomain\.com
RewriteCond %{http_host} !^www\.mydomain\.com
ProxyPass /classes http://www.myolddomain.com/classes

If I understand this correctly you want to force www ?

If so,


Options +FollowSymLinks -MultiViews 

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain\\.com$ [NC]
RewriteRule .? http://www.mydomain.com%{REQUEST_URI} [L,R=301]

ProxyPass /classes http://www.myolddomain.com/classes

That will first redirect from [noparse]mydomain.com[/noparse] to [noparse]www.mydomain.com[/noparse] and rrom there on Apache will run it through the proxy.