Hi, I have a virtual directory c:/storage with some directories inside for every account of my web site. Every user ID is a 12 lenght characters string. So I have a situation like this c:/storage/123456789012/ where I store every 123456789012 user resource.
The most common thing is to access to this directory by storage.mysite.com/123456789012/mypic.jpg but I would like to accomplish this storage.mysite.com/storage/12/34/56/78/90/12/mypic.jpc Is this an unaccomplishable request? Do I need to create all this subdir?
Any help will be very appreciated Giacomo
giviglie1976
1 Post
Url and virtual directory
May 02, 2012 12:26 PM|LINK
fab777
938 Posts
Re: Url and virtual directory
May 02, 2012 12:57 PM|LINK
Hi, I think you can use a rewrite rule for that, but since I'm not a rewriting specialist, just wait for them comments...
Please 'Mark as Answer' if this post helps you.
Fabrice ZERROUKI
Dalong Zhang...
647 Posts
Microsoft
Re: Url and virtual directory
May 04, 2012 04:25 AM|LINK
Hi,
Yes, you can use a rewrite rule, it will look like:
<rule name="page rewrite" stopProcessing="true">
<match url="^storage/12/34/56/78/90/12/mypic.jpc$" />
<action type="Rewrite" url="123456789012/mypic.jpg" />
</rule>
For more information about URL Rewrite rules, please refer to the following article:
Creating Rewrite Rules for the URL Rewrite Module
http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/
If you have anything unsure on this issue, feel free to post back.
Feedback to us
Develop and promote your apps in Windows Store