Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I can easily crate a directory structure like c:\temp\mywww\my\custom\path, and then create virtual directory to \mywww and place my files in path subfolder, and I'll be able to access it like:

http://my.exmple.com/my/custom/path

The question is, can I place my files mywww, and then create a virtual directory in such a way, so I access them using the above mentioned url. I.e. somehow the virtual directory alias to be "my/custom/path".

Thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted

If you create the website to have the default directory of "c:\temp\mywww" (where your index.htm files would be) and add "\my\custom\path" onto that, you will have the structure http://my.exmple.com/my/custom/path already... since it's a physical location under your default directory.

However, if you don't want those files located under "c:\temp\mywww\my\custom\path", you can add a Virtual Directory with the alias "/my/custom/path" and point it to and entirely different location (for example) "c:\virtual_directories\are\cool"

EDIT (from comments): To do this, first create a virtual directory "my", then in it a virtual directory "custom", and then another one in it "path".

This comes in handy when you have multiple websites use the same backend code, and the settings loads based on the website accessing the specific directory. So example.com/my/custom/path/index.aspx would read the username/password combination from the same database for example.com and seriously_another_example.com/my/custom/path/index.aspx would read the username/password combination for seriously_another_example.com BUT... both are running off the same piece of code (since both are aliased to go to c:\virtual_directories\are\cool) and the same database (if so desired)

share|improve this answer
    
New/VirtualDirectory ...: Alias: "/my/custom" results in "There are invalid characters in the alias name". –  Sunny Jun 24 '11 at 16:36
    
That's because you need to create the virtual directory "my" first and then create a virtual directory "custom" under "my". It works EXACTLY like normal directories ;) –  user85569 Jun 25 '11 at 7:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.