IIS Default Site - asp.net-mvc

I have an IIS configuration such that [mywebapp] is an asp.net mvc web app that exists under "Default Web Site" of myserver.com.
How do I configure my IIS so that a request to www.myserver.com actually displays the home page of [mywebapp], without changing the url to www.myserver.com/mywebapp. Currently the url change is what happens as I am using HttpRedirect on Default Web Site, but this is not what I want.

Assuming that you have a DNS record set that maps your server IP address to the domain name, you will need to set up a new site, rather than a virtual directory underneath Default website. When you create the site, enter your domain name in the Host name field.
You can test this configuration locally first by setting the site up in IIS and then adding an entry in your hosts file (C:\Windows\System32\drivers\etc\hosts) that maps the domain name to your localhost IP address 127.0.0.1 - just remember to remove that once you're happy with the setup or you won't actually be hitting the live IP address.

Related

Remove the custom port number from https url using IIS

I have a site which is configured in IIS7. Currently, the site named Site1, which uses the https protocol with a custom port number 5001. I can access this site by using the url given below:
https://demo.mydomain.com:5001/Site1
I need to eliminate the port number from the url, but it should access the same content which is used by the url "https://demo.mydomain.com:5001/Site1".
Expected result should be like this: "https://demo.mydomain.com/Site1"
Any help is much appreciated.
In IIS Manager, click on the Site (left pane) and the click Bindings (right pane). You'll see a binding for port 5001. Edit that binding to be port 443. (https://learn.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/site/bindings/binding)
My guess though is you have some other site that is bound to port 443, if that is the case you either need to remove it from the other site, or if you need them to coexist, you need to dig into SNI which is a bit more advanced topic (SNI and SSL on IIS 8.5)

How to configure a subdomain to open a subpage on the main domain with nginx?

So I have a domain example.com and a subdomain sub.example.com.
I would like to configure my Nginx virtual host to open the root site when a user uses the domain example.com but when a user uses sub.example.com the server should serve example.com/sub. The main problem I'm having is the URL changing. I do not want to simply redirect, instead, the URL should stay the same.
So basically you can open the same page by visiting example.com/sub or sub.example.com but the URL should always be sub.example.com.
In your nginx configuration file for sub.example.com, under location /,
You can proxy-pass to the page you want to show. In this case example.com/sub.
But if you have more links on example.com/sub page, your routing would need some tweaks. Else, it should work fine.

asp.net core RC2 iis hosting

I have hosted asp.net core app in IIS on window server 2012 R2 Standard. My site works fine when I use localhost based URL on the machine but when I try to access the URL using host name/machine name from network computer it does not work. What do I need to do to make it accessible from other computers?
There can be different reason for this:
Check your firewall to make sure your port 80 is open.
Check that the hostname point to the IP URL of your server.
What is the http code returned by the it does not work?
Tool:
Enter the Domain and IP, make sure they point to the same place.
http://www.hcidata.info/host2ip.htm
If firewall isn't the problem, and the site works via localhost on the server, make sure your IIS bindings are correct. Right click site, edit bindings, verify the domain / ip / etc match how you're trying to access it.

Accessing a Liferay portal with different hosts

What is the difference between accessing a Liferay portal with
http://portal.name.com for example, and http://name.com?
I noticed that when I use portal.name.com, an additional /web/guest is added to the URL. But when accessing the portal using name.com, the URL stays fixed.
If you're configuring an explicit virtual host name for a site, Liferay can find out what site you're referring to (that's the guest part of the URL) and omit it. web points to the public pages of a site - and always needs to be followed by a site name.
You can revert that behaviour by setting the site name for the guest URL to portal.name.com, which would cause the /web/guest part to appear on name.com.

unable to map subdomain in local host webserver

I am developing a web application using Asp.net mvc framework with concept of sub domain for community.
I have implement concept of wild card mapping of domain like *.example.com. To test concept in vs 2008 i edited hosts file and add some sub domain like
127.0.0.1 a.localhost
127.0.0.1 b.localhost
When i request url http://a.localhost:1760/ i get error
While trying to retrieve the URL: http://a.localhost:1760/
The following error was encountered:
Unable to determine IP address from host name for a.localhost
The dnsserver returned:
Name Error: The domain name does not exist.
This means that:
The cache was not able to resolve the hostname presented in the URL.
Check if the address is correct.
What i should do to resolve this error.
localhost can't have subdomains - it's a reserved DNS name that simply doesn't support them. You could, instead, use a.myhost.example and b.myhost.example, but be aware that Cassini, the VS development web server doesn't understand host headers.

Resources