LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > .htaccess proxy pass through

Reply
 
Thread Tools Display Modes
  #1  
Old 05-26-2010, 07:33 PM
EvoIX_MR2006 EvoIX_MR2006 is offline
Member
 
Join Date: Feb 2009
Posts: 29
Default .htaccess proxy pass through

Hello,

I am trying to use .htaccess to proxy a site through as a domain hosted on the litespeed server.

This doesn't work:
RewriteEngine on
RewriteRule (.*) http://www.google.ca/$1 [P]

But this does:
RewriteEngine on
RewriteRule (.*) http://www.google.ca/$1 [L]

The latter redirects directly to google.ca. If I put an external App of type web server and set it to the google IP, and leave the .htaccess as the top example, it does a redirect instead of a reverse proxy.

I beleive I asked about this a few months back, and was told the feature was being implemented? Can anyone confirm?

Thanks.
Reply With Quote
  #2  
Old 05-26-2010, 10:10 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
You need to create a web server external app with name "www.google.ca".
Reply With Quote
  #3  
Old 05-26-2010, 10:16 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
your example of google looks not good: it looks like google can detect this and refuse to be reverse proxy'ed.
Code:
RewriteEngine on
RewriteRule (.*) http://www.google.ca/$1 [P]
assume the name of your external App of web server is google_backend, the rewrite rule should be
Code:
RewriteEngine on
RewriteRule (.*) http://google_backend/$1 [P,QSA]
this can archive success partly:
for example, access http://yousite.com/abcd, it will access google.ca/abcd, and return a "404 Not Found" page from google.

However if you use your own site instead of google, should be successful.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:52 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.