Let's say I have a virtual host with a ServerName directive like so:
And in my hosts file:
Now when I enter
geekspeak.dev in my browser, I'm directed to my application running on localhost. Simple.
But what if instead of
geekspeak.dev, I want to require users to enter
geekspeak.dev/foo to get to my app. Is there an apache directive or some other technique that will allow me to accomplish this?
I tried adding an empty
DocumentRoot and an
Alias as suggested by Shi, but I had no success. I wonder if the fact that it's acting as a proxy has anything to do with it? I've pasted my virtual host below, maybe someone can see what's wrong with it.
<VirtualHost *:80> ServerName geekspeak.dev DocumentRoot /var/www/foo Alias /foo /var/www/foo ProxyPreserveHost On ProxyPass /excluded ! ProxyPass / http://127.0.0.1:9000/ ProxyPassReverse / http://127.0.0.1:9000/ </VirtualHost>
I'm expecting this to reach my app at
/ but instead it reaches my app at