• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

apache rewrite

I want to do a rewrite to a /blog on a remote URL, i have a IIS server and in front of it a apache/proxy but my rules do not work here is the conf:
<VirtualHost *:80>
        ServerName www.mysite.com
        RewriteEngine on                                                                                                                                              
        ProxyPass ^/blog/(.*)$  http://ec2-xx-xx-xx-xx.compute-1.amazonaws.com/$1                                                                                    
        RewriteRule ^/blog$     /blog/
  • 3
1 Solution
I think you need ProxyPass, not Rewrite.


ProxyPass /blog/  http://ec2-xx-xx-xx-xx.compute-1.amazonaws.com/
ProxyPassReverse  /blog/  http://ec2-xx-xx-xx-xx.compute-1.amazonaws.com/
lionel3030Author Commented:
Hi jackie and thanks for the reply.
What i am trying to do is to redirect all but a /blog and to redirect /blog to wp2.mysite.com
so right now i have
<VirtualHost *:80>
        ServerName www.mysite.com
        Options +FollowSymLinks
        RewriteEngine On
        RewriteCond %{HTTP}   ^www.mysite.com/blog$  [nc]
        ProxyPass ^/(.*)$          http://wp2.mysite.com/$1
 <Proxy balancer://mysite-cluster>
                Order allow,deny
                Allow from all
                BalancerMember http://wb1.mysite.aws route=wb1
                BalancerMember http://wb2.mysite.aws route=wb2

        ProxyPass /balancer-manager !
        ProxyPassMatch ^/(.+)$ balancer://mysite-cluster/$1 lbmethod=byrequests stickysession=BALANCEID
        ProxyPass / balancer://mysite-cluster/ lbmethod=byrequests stickysession=BALANCEID
        ProxyPassReverse / balancer://mysite-cluster/
lionel3030Author Commented:
solutions use proxypassmatch
lionel3030Author Commented:
Was in a rush resolved this issue alone
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now