1

Hi I'm using a BlogEngine.net for my blog and I would like to create 5 different subdomains and point to different subfolders(not redirecting). For example:

firstsubdomain.domain.com - domain.com/posts/helloworld.aspx
firstsubdomain2.domain.com - domain.com/posts/helloworld2.aspx
firstsubdomain3.domain.com - domain.com/posts/helloworld3.aspx

Thank you in advance for working example. I'm using asp.net 3.5, C#, Windows Server 2008, IIS 7

BorntoWin
  • 21
  • 2

2 Answers2

0

I think you have to create a new web site in IIS manager, point it to the folder where the files are, and set the hostname to subdomain.domain.com

Jan Sverre
  • 4,617
  • 1
  • 22
  • 28
  • That will work, but I need the solution which not required creating additional websites, maybe just one to handle all mapping. Because right now I need to create 5 subdomains and tomorrow it can be 200 so in my case creating a separate website for each subdomain not a solution. Thanks – BorntoWin Nov 26 '10 at 14:14
0

You have to use URL rewriting if you limitation on IIS and if you have full control on IIS then can do using .htaccess:

Check these links for more details:

Web.config and mapping subdomains to folders

http://learn.iis.net/page.aspx/465/url-rewrite-module-configuration-reference/

https://help.brinkster.com/KB/a125/how-do-i-redirect-a-domain-or-subdomain.aspx#b3

check this Ionic's ISAPI Rewrite Filter

IIRF is an ISAPI filter that does URL Rewriting for IIS. It's small, FREE, and easy to use. It is easy to install, fast, and powerful. You can get Search-Engine Friendly (SEF) or Search-Engine Optimized (SEO) URLs easily on IIS 6, 7, or 7+. It works with what you have, and there's help available to get you going. You can get the source code to inspect it or even modify it yourself.

Community
  • 1
  • 1
Niranjan Singh
  • 18,017
  • 2
  • 42
  • 75