Link to home
Start Free TrialLog in
Avatar of manicdiggity
manicdiggity

asked on

Virtual Directory In Apache Htdocs Dir

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

Thanks!
Avatar of edchipman
edchipman
Flag of Canada image

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.
SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
RewriteBase /

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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of edchipman
edchipman
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of manicdiggity
manicdiggity

ASKER

That worked, thanks!