How to rewrite a subdomain to a file rather than a directory

Hi,

I am successfully making the following redirection.  The URL:
something.MyDomain.com
delivers the index.html file that resides on my server here:
/data/www/MyDomain/root/something/index.html

Here's how I did it:
I added an A record with a wildcard before MyDomain.com
MyDomain.com is in a VirtualHost container in Apache's httpd.conf (because it's not the main domain that my server serves)

Here are the pertinent lines from httpd.conf:

<VirtualHost My.IP.Add.ress:80>
ServerName www.MyDomain.com
   Options +FollowSymLinks
   Options +Indexes
ServerAlias www.MyDomain.com MyDomain.com *.MyDomain.com               
DirectoryIndex index.html
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.* [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.MyDomain\.com
RewriteRule ^(.*) /%1/$1 [L]

What I would LIKE to do is have
something.MyDomain.com
redirect NOT to a subdirectory, but rather to a file in the root directory.  I'd like
something.MyDomain.com to deliver the file:
/data/www/MyDomain/root/something.html

Can this be done?  I can't quite figure it out.
Thanks,
--Steve D.
StevenMilesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve BinkCommented:
Same idea as your example:

RewriteRule ^/?$ http://mydomain.com/root/%1.html [R]

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
StevenMilesAuthor Commented:
Perfect.  Yup, just for some reason couldn't get that last step myself.  Thanks mucho.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.