Unusual multiple website setup on Windows Server 2012 R2 - iis

I currently have the following website setup on Windows Server 2012 R2. The following website is catching all the traffic to the webserver and then adding a few URL rewrite rules, such as forcing HTTPS and appending www.
I want to add a second website under a subdomain of the above site and diferent source code. How do I go about it?
EDIT: I've created a second website with a binding to the subdomain but all traffic is being redirected to the first website, as setup above. Does the first website require a defined Host Name? If so, that's not possible because the code of the website above is handling about 100 domains. The content is loaded based on domain name. So probably adding a subdomain of one of the websites is not possible. Is someone able to clarify, please?

Just create a new website in IIS for example hostname site1.yourdomain.com and set the bindings and and point to website folder.
create a 2e website with hostname site2.yourdomain.com set bindings, and point to your 2e website folder.
and you can have a main site with hostname www.yourdomain.com or yourdomain.com
also set an ip if you want to bind to a specific ip only.
it is important to set the hostname.

Related

How create symbol link for subdomain in IIS, which will open another domain running on IIS

I created a new site on IIS, for example mysite.com. Site is running, it is opened in browser, all good.
But I need create subdomain 1.mysite.com, which will open mysite.com. I don't mean a redirect. I mean open in browser 1.mysite.com and will be opening mysite.com
How can I do this on IIS?
Since you basically want two different names for your website
create a DNS entry for 1.mysite.com to point to mysite.com host entry
in IIS ,you can just add another binding with hostname 1.mysite.com

IIS 7 IP address forwarding

I want to move some websites from server 1 to server 2.
My clients have A records pointing to the IP address of server 1. Without updating their DNS records, how can I automatically forward request for those domains from server 1 to server 2?
Thanks
Graham
This image is from an article regarding Exchange, but the IIS settings are relevant.
You can redirect at the HTTP level by specifying a URL redirect in IIS's HTTP Redirect settings:-
However, for this approach to work you will need a new domain for your sites. e.g. if the A record resolves www.example.com to Server 1 you will need to redirect to another URL (e.g. www.example.edu) that already resolves to Server 2.
Another option is to setup a reverse proxy using IIS on Server 1:
Today there was a question in the IIS.net Forums asking how to expose two different Internet sites from another site making them look like if they were subdirectories in the main site.
So for example the goal was to have a site: www.site.com expose a www.site.com/company1 and a www.site.com/company2 and have the content from www.company1.com served for the first one and www.company2.com served in the second one
So slightly different requirements (the article only wants a subdirectory rather than the whole site), but the same concept will apply.

How to display content from another domain by editing CNAME records?

I have a site that lets people have their own e-stores, for ex- mysite.com/clientname
What I want is, if somebody opens store.clientname.com or clientname.com/store, the content is pulled from mysite.com/clientname. [ So that their users feel that they are browsing on their site ]
I know this is possible because site'e like tumblr let you do that by changing a CNAME entry for your domain to their IP address.
I do have a dedicated IP address.
Also, can this be done by editing the .htaccess file at clientname.com, and if yes, which method is better/easy?
You'll want to solve the problem in a completely different way for http://store.clientname.com/ versus http://clientname.com/store.
In the first case, you can serve the web site as a virtual host. Just set up a virtual host called store.clientname.com and set its DocumentRoot to be the existing directory that contains the files for http://mysite.com/clientname. If you have other web server configuration directives that apply to http://mysite.com/clientname then you'll also want to apply those in the virtual host. Finally, the client can set up a CNAME record in DNS for store.clientname.com pointing to your web server.
If you are using Apache, you can also use a default virtual host and mod_rewrite to dynamically translate URLs of the form http://store.{whatever}/ to http://mysite.com/{whatever}/. However, this won't work if you are using HTTPS.
In the second case, you don't want to serve the web site at http://clientname.com/ because the client presumably is already hosting that and presumably http://clientname.com/otherstuff has to continue working and come from their server. So the second case is easier for you because all the work has to be done on the client's web server. But it's simple: they will just have to configure their web server to proxy http://clientname.com/store to http://mysite.com/clientname.

How to do a no-DNS site preview, when a wildcard redirect is in place

I'm looking to figure out how to replicate the functionality of GoDaddy's PreviewDNS when I'm moving a site to my own web host based in cpanel.
My setup is this: I have a wordpress multiuser site setup with a subdomain install, and a wildcard redirect.
I can't figure out how I can preview the website for an account before the DNS is switched over to my host from the old host.
I've been able to sorta do this by creating an A record of a subdomain over to my host, but I still have the issue of not being able to test the actual files instead of a copy in a subdomain.
I have two IP addresses attached to the server, one to the server itself and all the shared domains, and the other dedicated to the WP multisite.
When I go to http://ipaddress/~username/, I either get an error, or get redirected to the wordpress multisite's default "this site doesn't exist, sign up now to create it" page. I've tried this with both IP addresses with no avail.
Any ideas?
I think what you're trying to do is ensure that everything is working on the new server before having the DNS globally changed for all users? You could change your local computers hosts file to point the domain (and any subdomains you wish to test) over to the new dedicated IP address, which is essentially moving the DNS over for just yourself.
Here's a pretty good guide on how to do it: http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

Subdomain mapping to another external subdomain

I'm trying to map help.domain1.com to help.domain2.com. I've seen this on UserVoice. They let you map something.yourdomain.com to something.uservoice.com.
On domain1.com I've set up a CNAME to help.domain2.com.
It works fine but when I open help.domain1.com I get the content of domain2.com instead of help.domain2.com.
After some experimenting I've realized that this is an expected behavior.
So my question is what do I have to do on domain2.com (or maybe on domain1.com?) to have it show content of subdomain "help.domain2.com" when I navigate help.domain1.com?
(I'm using Plesk and the OS is Windows Server 2003)
I was facing the same problem for the last couple of days, and just found the solution...
In /etc/apache2/site-available/default, I had two virtual hosts, first one was for my domain, and the second one was for my sub domain. All I had to do was reverse the order of the virtual host blocks, placing the sub domain in front of the domain, and it worked! :D
I found the solution. One way would be to use a mod_rewrite rule on domain2.com and do a redirect if referrer is domain1.com. Or to assign a dedicated IP address.
HTTP/1.1 uses the Host: header to figure out which site is being requested, should there be more than one site hosted on the same IP address.
You need to ensure that the second (target) web-server is configured to expect incoming HTTP requests with the original URI in them.
I am not 100% sure how to do this in windows but in apache you just need to setup a virtual host to redirect it from the main domain to your subdomain.
you do not say if you are using IIS or apache or what the webserver is.
I imagine that what you need to do is setup a new website in IIS (not a virtual directory) and in the website tab click on advanced and edit the entry in there so that the "host header name" is the subdomain you want.
Jon Hawkins

Resources