lionel3030
asked on
apache rewrite
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.
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.
ASKER
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>
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/
ProxyPass / balancer://mysite-cluster/
ProxyPassReverse / balancer://mysite-cluster/
</VirtualHost>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Was in a rush resolved this issue alone
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/