[LRUG] [OT:Apache] Mapping multiple domains to different controllers?
Johnathan Loggie
me at johnno.com
Tue Apr 14 05:13:37 PDT 2009
OK, this time I tested everything, and on my machine this will work by
proxying from one site to the other, except for the index.html if present.
<VirtualHost *:80>
ServerName somethingelse.local
DocumentRoot /home/matthew/myapp/public/other_domain
RewriteEngine On
# If there is an index.html use it in the usual way (no rewrite and stop)
RewriteCond %{DOCUMENT_ROOT}/index.html -f
RewriteRule ^/$ - [L]
RewriteRule ^/index.html - [L]
# Proxy assets to root of other site
RewriteRule ^/stylesheets(.*)$ http://mydomain.local/stylesheets$1 [P]
RewriteRule ^/javascripts(.*)$ http://mydomain.local/javascripts$1 [P]
# Proxy everything else to subdir of other site
RewriteRule ^(.*)$ http://mydomain.local/myapp$1 [P]
</VirtualHost>
On 14/04/2009 12:32, "Johnathan Loggie" <me at johnno.com> wrote:
>
> Hi,
>
> I was wrong in what I said for using mod_rewrite in part 2 as this will
> create a redirect, but funnily enough I tried your config out using only the
> ProxyPass directive and mod proxy worked fine to proxy to the first vhost
> from the second without any changes. The only problem was the url's to
> assests like css and javascripts ended up incorrect but that is fixable.
>
> When you say mod proxy doesn't work, what do you mean exactly?
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
More information about the Chat
mailing list