Hi, I have an ecommerce store. dns at godaddy. A record www points to the 3dr party hosted shopping cart solution on ip a.a.a.a I also have a blog. A record blog subdomain points to another server b on ip b.b.b.b hosted away from the shopping cart server a completely. So www goes one place and blog goes to another. The problem is I need to somehow make the blog appear within the main site as www.mydomain.com/blog instead of as a subdomain blog.domain.com. I cannot access or modify the hosted shopping cart server in any way. I cannot load wordpress there, that is why it is on a completely separate server. I've been told this is perhaps possible with a reverse proxy configuraton on server b where ip b.b.b.b is. So that even though blog. points to server b it can appear that the url is www.mydomain.com/blog and the blog pages off that directory as well. Can this be done via reverse proxy? Can it be done another way? Can someone help me accomplish this hopefully? Thanks!
Thank you for your help but I believe you've mis-understood the configuration. This answer won't help me. Server B where the wordpress blog is is the one that needs to be configured, not server A anyways.
For you to rewrite "www.example.com/blog" into "blog.example.com" you need to have Apache mod_rewrite on the web server who host "www.example.com".
You've got it backwards. "blog.example.com" needs to display as "www.example.com/blog" And "blog.example.com" is hosted on a different server and ip than "www.example.com" This isn't a simple mod_rewrite issue. If they were on the same server with same ip then sure a quick rewrite rule would do it. In this case they are on 2 different servers on 2 different ips in 2 different geographical locations......
This placed on server B where only blog.example.com resolves RewriteCond %{HTTP_HOST} ^(www\.)?example\.com/?$ RewriteRule ^blog(/.*)$ http://blog.example.com$1 [P] ProxyPassReverse / http://blog.example.com/ will make blog.example.com or anything after it appear as www.example.com/blog or www.example.com/blog/etc etc etc?
Try: RewriteEngine on RewriteBase / RewriteRule ^(.*)$ http://www.example.com/blog/$1 [P] ProxyPassReverse / http://www.example.com/blog/ Code (markup): Or: RewriteEngine on RewriteBase / RewriteRule ^(.*)$ http://www.example.com/blog/$1 [P] Code (markup): I call it super proxy.
Please wait a minute before checking it. Also, is your .htaccess file in the root of "blog.example.com"?