apache rewrite

Posted on 2011-09-15
Medium Priority
Last Modified: 2012-05-12
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/
Question by:lionel3030
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3

Expert Comment

ID: 36545272
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/

Author Comment

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

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

Accepted Solution

lionel3030 earned 0 total points
ID: 36546565
solutions use proxypassmatch

Author Closing Comment

ID: 36565531
Was in a rush resolved this issue alone

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

718 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