Solved

apache rewrite

Posted on 2011-09-15
4
329 Views
Last Modified: 2012-05-12
Hi,
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/
</VirtualHost>
Thanks.
0
Comment
Question by:lionel3030
  • 3
4 Comments
 
LVL 7

Expert Comment

by:jackiechen858
ID: 36545272
I think you need ProxyPass, not Rewrite.


Try

ProxyPass /blog/  http://ec2-xx-xx-xx-xx.compute-1.amazonaws.com/
ProxyPassReverse  /blog/  http://ec2-xx-xx-xx-xx.compute-1.amazonaws.com/
0
 

Author Comment

by:lionel3030
ID: 36545750
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
        </Proxy>


        ProxyPass /balancer-manager !
        ProxyPassMatch ^/(.+)$ balancer://mysite-cluster/$1 lbmethod=byrequests stickysession=BALANCEID
        ProxyPass / balancer://mysite-cluster/ lbmethod=byrequests stickysession=BALANCEID
        ProxyPassReverse / balancer://mysite-cluster/
</VirtualHost>
0
 

Accepted Solution

by:
lionel3030 earned 0 total points
ID: 36546565
solutions use proxypassmatch
0
 

Author Closing Comment

by:lionel3030
ID: 36565531
Was in a rush resolved this issue alone
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now