Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 23, 2012 10:23 AM by DarrellNorton
Apr 23, 2012 10:15 AM|LINK
Is it possible to do something similar to server.transfer , but to automatically apply it to all files in one subdirectory and transfer them to the same structure in another directory, without the user seeing any change in the URL.
e.g. if I have the files:
Then anybody requesting:
will be transferred to \sub1\page1.aspx without their URL changing. I'd also like to know what the URL is the user made the request from, for example with HttpContext.Current.Request.Url, preserver querystrings etc. as is the case for server.transfer
My list of alternative subdirectories is defined, so I don't mind creating a folder for each on the server and putting a web.config file in it or similar to create the rules. What I would rather not do is recreate the entire structure of pages in each subfolder
using pages with the same name but with a server.transfer to sub1 in each - though that is my fall-back position if there is no better option.
Maybe using URL Rewrite module? Any suggestions appreciated.
Apr 23, 2012 10:21 AM|LINK
refer to this link
Apr 23, 2012 10:23 AM|LINK
This URL Rewriting solution does what you want: