How to have multiple web site with one URL? - asp.net

I have 2 web projects, with one URL: www.theurl.com, which is directed to the ISA server, behind this server is a web server (windows 2003).
I have a default web site, and another web site which I want to add (website2). When the user clicks the URL, directly goes to my first web site.
How can I have for example: www.theurl.com/website2 and how should I configure the IIS without using another port? I am using port:80
Thanks in advance

Could you have the hostnames be the way to separate the sites? That may be a way to do this, but that is in the bindings in IIS I believe.

Use the hostnames to allow IIS to filter and direct the requests based on site. See here:

Related

Can two ASP.NET applications share domain name on a single IIS server?

I wanted to elaborate some more on this question, but it is a straightforward one. Is it possible that two ASP.NET Web Api applications use the same domain ie. host name on a single IIS?
app1
www.domain.com/api/users/ POST
app2
www.domain.com/api/guests/ POST
This is possible yes, IIS supports multiple applications under a "parent".

Redirect & mask URL to Azure subdomain

I have an ASP.NET MVC web app running on Azure as generic-site.co. It's a white-label site that supports a number of subdomains: acme.generic-site.co, globex.generic-site.co, initech.generic-site.co, etc. Browsing to each of them changes branding on the pages, but the underlying functionality is exactly the same.
Meanwhile I have an external domain name acme-site.com hosted by GoDaddy. I want to redirect this specifically to the acme.generic-site.co subdomain, but I also want to maintain acme-site.com as the root URL for any further browsing on that site, allowing users to have a pure acme experience without any indication of the underlying generic-site-ness.
I've tried to do this using GoDaddy's Domain Forwarding with masking, but I ran into CSRF issues almost immediately.
Is there any way I can achieve this? I suspect IIS URL rewriting might be helpful, but I'm at a loss as to how to proceed.
Don't use Domain Forwarding with masking.
Just add custom domain acme-site.com to Azure Web App.
And you may need to do one of the following:
Add a middleware or something that change Host in HTTP request header from
acme.generic-site.co to acme-site.com.
Adjust the application to
load correct branding when using domain acme-site.com.
It is probably easier to use IIS Url Rewrite module as you mentioned in your question. There are several examples on how to do this. Please start with this post by Scott Forsyth: https://weblogs.asp.net/owscott/iis-url-rewrite-redirect-multiple-domain-names-to-one

Deploy web site without using a domain

I am new to the web world, so I apologize if this question is silly.
I have an ASP.NET web site I wish to deploy.
The server has IIS 7 deployed on it, and I've added the site
to that IIS server as a web site.
For the time being I don't have a domain mapped to the site,
I would like the users to browse for the site directly by using the server's IP.
Is that even possible? because I failed to do it.
The only option that worked so far is using the hosts file to declare
a fake domain.
It would be nice if someone could clarify that issue for me.
Thanks a lot,
Omer
If you set the site bindings to IP address: All Unassigned on port 80, and do not provide a host name, then any request that makes it through to IIS should be served by that site. Make sure you stop any other sites that might have that binding (e.g., "Default Web Site" is normally bound to this).
In order to access the site by IP, you can't have the host name populated in IIS. Your best bet would be to use the "Default Web Site" that's already in IIS, and point that to your application.
Using IP is possible, but you need to make sure your users can see this ip from their machines.

Setting up asp.net test server

I am creating a website in asp.net MVC 4 and am wondering the best way to set up a test server?
I am doing this from home and would like a way for my friend to test my code from a different location (his home). What would the best way to go about this? Build a local server that he only has access to? VMWare? Online web hosting?
One solution would be to use a VM and set up a server.
NOTE! that this would require your friend to redirect your IP Adress to the host name you will set for your website on the IIS of your VM.
He can easily do that by changing his Hosts at C:\Windows\System32\drivers\etc
Another option would be actually to purchase a domain (that you will need anyway eventually)
The purchase a hosting package (that you will also need anyway eventually).
Then setup your website on a sub domain in that hosting server e.g. dev.myDomain.com

ASP.NET Domain Controls

a client asked me today about having users be able to have their own domains within the web application.
example would be:
http://example.com/User/View.aspx?=60
would change into http://userpage.com/
I am not sure how to approach this, can anyone provide me few pointers?
Here is complete documentation from Microsoft on how to use multiple host headers. Essentially, you configure the web server (IIS) with multiple web sites, then within each website you configure the list of host headers that the site should respond to. This allows you to host multiple sites on the same server:
http://support.microsoft.com/kb/190008 (or similar articles for other versions, such as http://technet.microsoft.com/en-us/library/cc753195%28WS.10%29.aspx or http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/e7a21b1f-ab13-47f2-8c61-b09cf14a7cb3.mspx?mfr=true)
Provided they have the domain and it is on a client's server, you can forward based on the id presented (60).
If http://userpage.webapp.com, you can use routing rules in ASP.NET 4.0 to handle this (some functionality in 3.5, I think, but 4.0 is better).

Resources