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).
Related
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".
We have a ASP.NET MVC4 WebAPI Portal RIA (a mouthful, I know). The Portal UI is implemented using extjs and static html (ie no views), and all dynamic behavior is driven via RESTful JSON service end points implemented via the System.Web.Http.ApiController. Currently, the website is deployed in production as a single site with two site bindings (ie two different URLs) in IIS: one URL is internal and provides access to the full portal, the other is HTTPS and is intended to provide external authorized users access to the RESTful JSON API portion of the site. Effectively, this means that while the internal URL allows full access to the site, ideally, the external URL should:
Only allow respond to JSON requests
Not allow access to the default page (eg index.htm)
What is the best way to accomplish this goal in IIS or otherwise? Is there a better alternative to the shared site with multiple site binding configuration we are currently using? Any insight would be deeply appreciated.
Probably the easiest solution (from all those that involve coding your own solution) would be to implement an HTTP Module that intercepts all calls and do all the filtering logic in your code based on the domain name or IP.
Here is a very simple example of how you can do that: Using ASP.NET HTTP Modules to restrict access by IP address
I am not aware of any way to accomplish your task purely by changing a configuration.
I’ve scoured the Internet via Google and could not find if it is possible to host ASP .Net and Ruby on Rails on the same server!
Do you know if it is possible?
If not, would I be able to do this?
– www.abc.com – redirects to Page A (hosted on Ruby on Rails server)
– jobs.abc.com OR www.abc.com/jobs - redirects user to Page B (hosted on ASP .Net server)
So from the user point of view, they’re both under the same domain name and appear seamless? So perhaps jobs.abc.com points to a different IP address.
Has anyone done this before?
Thank you all.
Yes, the same physical computer can host RoR and ASP.NET at the same time.
To merge two apps on separate platforms and make them appear as one seamless site is a little more challenging. One not very nice option is to use IFRAMEs to render one site (B) inside another's (A) pages, allowing the top-level URL to still show A's domain, etc.
It sounds like finding out more about the issue you are trying to solve would be a good idea, as going down this road is likely to create a mess in the future, and should be avoided if at all possible.
You can also use sub-domains like you suggested, so that the domain names are similar but not exactly the same.
You will also need to consider how to share authentication, etc., across sites.
You'll not find a host that supports both I guess.
I'm thinking of something similar. Seems a Windows VPS hosting is the way to go, and then I can install Ruby to IIS as FastCGI filter, or even have another server side by side but I don't expect this to work flawlessly when both servers will need to listen to port 80 (doable I guess, but probably troubling).
BTW, for the jobs.abc.com scenario you don't need the two apps on the same server. You can have them on two servers and manage the difference via DNS.
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:
I have the need to add Host Headers to an existing web site in IIS. I want to be able to add this host header via a Web page, ASPX page. Also, I want to able to create a new web site from file.
Sample code?
How to do I manage security issues, what issues should I be concerned about?
How many host headers can a single web site have?
I am using the ASP.Net membership provider on the site.
Server is running IIS7 and Windows 2008 Server.
WMI is the best way to create website from your pages, I have used it and had referred http://blogs.msdn.com/ramesh_r/archive/2004/03/24/95109.aspx link.
This is really a cool link to understand/ learn WMI programming.
You can download WMI code generator from http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en
IIS 7 Has a managed code API which should allow you to do what you need.
Take a look at the API documentation from Microsoft, here: http://msdn.microsoft.com/en-gb/library/aa347649.aspx
This blog may be useful, too.