Take the 2-minute tour ×

This is an outside shot I know. I am supporting a site that has constantly changing assets that are excluded from the repository for obvious reasons. Currently I am having to FTP these assets to my local computer in order to develop and test properly. What I want to do is simply link to the assets on the server. I thought this might be possible using Apache's mod_alias, but I cant get it to work:

Alias /assets http://www.mysite.com/assets

Is this possible? Is there an alternative way of doing this?


share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You can use mod_proxy to make Apache fetch resources from a remote server and then return them under that URL:

ProxyRequests Off
ProxyPass /assets http://www.mysite.com/assets
ProxyPassReverse /assets http://www.mysite.com/assets


share|improve this answer
yes (+1), mod_alias is a way to map an url to a local filesystem resource. Mapping an external web resource is the job of a proxy. –  regilero Mar 29 '12 at 19:03
Perfect that worked a treat. Thanks! –  lopsided Mar 30 '12 at 14:20
what if you wanted to create the redirection from a virtual host? I mean to make http://mysite.localhost point to http://www.mysite.com... how would you proceed? –  Jago Jul 23 '13 at 4:16
@Jago same way, just use the directives above inside your vhost definition and add ServerName mysite.com and ServerAlias www.mysite.com. You just need to ensure DNS for mysite.com resolves to your vhost mysite.localhost definition. –  Brian Vanderbusch Jan 31 at 17:33
add comment

Your Answer


