Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to create a Location/LocationMatch directive in my configuration file to ProxyPass my website homepage "http://www.example.com" without affecting any other Locations and Directories.

I tried <LocationMatch ^$> but it did not work at all. How can I create that location if possible?

Thanks,

share|improve this question
    
Do you mean you want to ProxyPass for only homepage (index.x)? –  quanta Sep 26 '11 at 4:46
    
I want to to make "example.com"; to be proxy passed to other server, currently it is displaying the index.html on the server itself but I want to display the index.html on another cluster of servers. –  wael34218 Sep 26 '11 at 6:22
    
Where did you read that LocationMatch didn't work inside a VirtualHost? The documentation states that a vhost is a perfectly valid context. What's the rest of your config look like? You may be preventing that config from working correctly with some other config. –  Shane Madden Sep 26 '11 at 16:10
    
@Shane I read that in an old forum post, I was a bit hasty on updating my post. Thanks for the correction. –  wael34218 Sep 26 '11 at 19:40

2 Answers 2

up vote 1 down vote accepted

Add the below line in your virtual host:

ProxyPass /index.html http://another.cluster.server.IP
share|improve this answer
    
Thank you for your awesomeness –  wael34218 Sep 27 '11 at 3:52

The root of URL space is "/", not "". Try ^/$ instead.

share|improve this answer
    
I tried it didnt work. the root directory handles it instead of my new location –  wael34218 Sep 26 '11 at 4:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.