0

I am running Apache on a box. I want to redirect every hit coming to that site to the entry page of a different site.

Site1 is www.site1.com Site2 is www.site2.com

I want every URL on Site1 to be redirected to site2 after stripping out everything at the end - i.e.

1) www.site1.com ==> www.site2.com/
2) www.site1.com/abc ==> www.site2.com/ (NOT site2.com/abc)
3) www.site2.com/pqr/mno ==> www.site2.com/ (NOT not site2.com/pqr/mno)

I have the following ProxyPass setting in Site1

ProxyPass / http://www.site2.com/

1) works fine - i.e. site1.com goes to site2.com
2) & 3) try to go to /abc & /pqr/mno on site2.com

How to I prevent this - I want everything on site1.com to go to the entry page on site2.

Genboy
  • 69
  • 1
  • 9

1 Answers1

1

Are you really sure you want to use the ProxyPass directive ? Is www.site2.com a public server all you client can access ?

If yes, then it looks more like a redirect to me.

But if www.site2.com is really a "private site" you want to proxy through www.site1.com, then perhaps ProxyPassMatch could be used like below:

ProxyPassMatch ^/(.*)$ http://www.site2.com/
Julien
  • 430
  • 3
  • 12
  • ProxyPassMatch ^/(.*)$ http://www.site2.com/ doesn't work. It redirects http://www.site1.com/abc to http://www.site2.com/abc. I want everything to be redirected to base site2. – Genboy Apr 21 '11 at 06:05