Reverse Proxy
7 posts
• Page 1 of 1
Reverse Proxy
I have a website located at hosting A, e.g. mysite.com. I created a blog located at Hosting B, which is a subdomain of hosting A, blog.mysite.com
I need to do a reverse proxy because I want the blog to be a subdirectory, mysite.com/blog
I've tried the following reverse proxy rule, but it doesn't seem to work. What did I do wrong? Any help would be appreciated. Thanks.
RewriteProxy ^/blog(/.*)?$ http://blog.mysite.com$1 [NC,U]
I need to do a reverse proxy because I want the blog to be a subdirectory, mysite.com/blog
I've tried the following reverse proxy rule, but it doesn't seem to work. What did I do wrong? Any help would be appreciated. Thanks.
RewriteProxy ^/blog(/.*)?$ http://blog.mysite.com$1 [NC,U]
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Reverse Proxy
Hello,
I assume you want to use the following in your hosting B config file:
Usually people want to request blog.domain.com and have the content being loaded from site.com/blog. Did I understand your situation correctly?
Regards
Andrew
I assume you want to use the following in your hosting B config file:
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond ^blog\.mysite\.com$ [NC]
RewriteRule ^(.*)?$ http://www.mysite.com/blog/$1 [NC,P]
Usually people want to request blog.domain.com and have the content being loaded from site.com/blog. Did I understand your situation correctly?
Regards
Andrew
Re: Reverse Proxy
Actually, it's the opposite. I want to request site.com/blog, but want the content to be loaded from blog.site.com. For SEO purposes, I want the link to be a subdirectory and not a subdomain, which is why I need to do a reverse proxy.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Reverse Proxy
That's quite unusual ![Smile :)](./images/smilies/icon_e_smile.gif)
Regards
Andrew
![Smile :)](./images/smilies/icon_e_smile.gif)
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond ^www\.mysite\.com$ [NC]
RewriteRule ^blog/(.*)?$ http://blog.mysite.com/$1 [NC,P]
Regards
Andrew
Re: Reverse Proxy
Hi Andrew,
It doesn't seem to work. My main ecommerce website is on mysite.com on host A, but my wordpress blog is hosted on host B as a subdomain (blog.mysite.com). I pointed blog.pimfg.com on my DNS to the IP of host B. Since mysite.com is hosted on my own server, that includes subdirectories on my server, I need a way to do a reverse proxy so that I can type mysite.com/blog (which doesn't exist), but get content from blog.pimfg.com. They are on 2 completely different servers, so I read that ISAPI rewrite has a reverse proxy function that allows me to type a site on my server, but get the content from another server without redirecting the URL. I got the information from this article moz.com/blog/what-is-a-reverse-proxy-and-how-can-it-help-my-seo and other forums suggest using ISAPI Rewrite for this.
- Regards, William
It doesn't seem to work. My main ecommerce website is on mysite.com on host A, but my wordpress blog is hosted on host B as a subdomain (blog.mysite.com). I pointed blog.pimfg.com on my DNS to the IP of host B. Since mysite.com is hosted on my own server, that includes subdirectories on my server, I need a way to do a reverse proxy so that I can type mysite.com/blog (which doesn't exist), but get content from blog.pimfg.com. They are on 2 completely different servers, so I read that ISAPI rewrite has a reverse proxy function that allows me to type a site on my server, but get the content from another server without redirecting the URL. I got the information from this article moz.com/blog/what-is-a-reverse-proxy-and-how-can-it-help-my-seo and other forums suggest using ISAPI Rewrite for this.
- Regards, William
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Reverse Proxy
That's exactly the code you wanted. What kind of result do you get?
We should probably take a look at the rewrite.log. Logging issues are described in http://www.helicontech.com/forum/10648-FAQ.html
Regards
Andrew
We should probably take a look at the rewrite.log. Logging issues are described in http://www.helicontech.com/forum/10648-FAQ.html
Regards
Andrew
Re: Reverse Proxy
mogwyz
Have you got a working script for it to work yet? I tried the following script but in rewrite.log it shows not-matched and it shows 403 forbidden
Log
173.55.182.159 173.55.182.159 Wed, 20-Nov-2013 00:37:49 GMT [www.mydomain.com/sid#740773336][rid#21635008/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
173.55.182.159 173.55.182.159 Wed, 20-Nov-2013 00:37:49 GMT [www.mydomain.com/sid#740773336][rid#21635008/initial] (1) Htaccess process request d:\mydomain\home\blog\.htaccess
173.55.182.159 173.55.182.159 Wed, 20-Nov-2013 00:37:49 GMT [www.mydomain.com/sid#740773336][rid#21635008/initial] (3) applying pattern '^(.*)?$' to uri 'blog/'
173.55.182.159 173.55.182.159 Wed, 20-Nov-2013 00:37:49 GMT [www.mydomain.com/sid#740773336][rid#21635008/initial] (4) RewriteCond: input='^www.mydomain.com$' pattern='[NC]' => not-matched
Have you got a working script for it to work yet? I tried the following script but in rewrite.log it shows not-matched and it shows 403 forbidden
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond ^www\.mydomain\.com$ [NC]
RewriteRule ^blog/(.*)?$ http://blog.mydomain.com/$1 [NC,P]
Log
173.55.182.159 173.55.182.159 Wed, 20-Nov-2013 00:37:49 GMT [www.mydomain.com/sid#740773336][rid#21635008/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
173.55.182.159 173.55.182.159 Wed, 20-Nov-2013 00:37:49 GMT [www.mydomain.com/sid#740773336][rid#21635008/initial] (1) Htaccess process request d:\mydomain\home\blog\.htaccess
173.55.182.159 173.55.182.159 Wed, 20-Nov-2013 00:37:49 GMT [www.mydomain.com/sid#740773336][rid#21635008/initial] (3) applying pattern '^(.*)?$' to uri 'blog/'
173.55.182.159 173.55.182.159 Wed, 20-Nov-2013 00:37:49 GMT [www.mydomain.com/sid#740773336][rid#21635008/initial] (4) RewriteCond: input='^www.mydomain.com$' pattern='[NC]' => not-matched
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests