1

For example, I have a Web Application www.mywebsite.com based on classic ASP.NET and IIS 7.5. Now I registered another domain name www.mywebsite.cc. In my Web Application I want to create subfolder /cc and somehow transparently rewrite all requests from www.mywebsite.cc/something to www.mywebsite.com/cc/something. Why I need this? I want both websites to share same static variables, cache, database connections etc. Please point me what technology I must dig in order to implement what I need.

Denis
  • 3,653
  • 4
  • 30
  • 43

1 Answers1

0

There are a couple of ways to do this, you might try URL rewriting. Your code might look something like this, but you'll need to adjust the line following string: "^something/?$|^something/(.*)$" to contain the proper match code. This should get you started and hopefully someone else will be able to comment on the proper match code.

<rewrite>
  <rules>
    <remove name="RedirectToUtility"/>
    <rule name="RedirectToUtility" stopProcessing="true">
      <match url="^something/?$|^something/(.*)$"/>
      <conditions/>
      <serverVariables/>
      <action type="Redirect" url="http://www.mywebsite.com/cc/something/{R:1}"/>
    </rule>
  </rules>
</rewrite>

http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module

Seventh Son
  • 131
  • 6