I have two applications running in the same server and I would like to have one served from subpath in the url (i.e):
I'm trying to do an alias but is not working:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName foo.com
DocumentRoot /webapps/foo/current/public
<Directory /webapps/foo/current/public>
AllowOverride all
Options -MultiViews
</Directory>
RailsEnv staging
Alias /blog /webapps/blog/current
<Directory /webapps/blog/current>
allow from all
Options +Indexes
</Directory>
Do you know why this is not working?
I also tried serverpath directive without any success.
Do you know how to achieve this?
Thanks in advance.
Use AliasMatch
instead of Alias
:
AliasMatch ^/bar/?(.*) /var/www/bar/$1
Or, in your case:
AliasMatch ^/blog/?(.*) /webapps/blog/current/$1