Virtual Directory In Apache Htdocs Dir

manicdiggity used Ask the Experts™
Is there a way to have a virtual directory in Apache for a directory within the parent directory?  So for instance, if I have a virtual host that points to \htdocs\mysite, and I want to have /images point to \htdocs\mysite\version1\archive\graphics, how would I do this?

I'm having to balance converting an old system to a new one, so I can't simply move the \htdocs\mysite\version1\archive\graphics into the \htdocs\mysite\images folder

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
We'll you could use mod_rewrite, it wouldn't be a virtual directory but it would give the illusion of it from the users perspective atleast.
RewriteEngine On
RewriteBase /

RewriteRule ^mysite/images/(.*)$ mysite/version1/archive/graphics/$1 [L]

Open in new window

Make sure you put that in a .htaccess file and it is in the root (\htdocs) also you may need to ensure mod_rewrite is enabled on the server and AllowOverride is configured correctly.


That worked, thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial