point ip to a virtual path - asp.net

I have a webserver asp.net with 1 ip and several domain name.
let say:
174.1.1.1
with domain.com domain2.com domain3.com
If i go to 174.1.1.1 it show
"Under Construction
The site you are trying to view does not currently have a default page. It may be in the process of being upgraded and configured."
So If I navigate to 174.1.1.1 I want it redirect to domain2.com
so how can I do that?
I'm using visual studio 2010 with win xp and iis

IIS6: To redirect requests to another Web site or directory
In IIS Manager, expand the local computer, right-click the Web site or directory you want to redirect, and click Properties.
Click the Home Directory, Virtual Directory, or Directory tab.
Under The content for this source should come from, click A redirection to a URL.
In the Redirect to box, type the URL of the destination directory or Web site. For example, to redirect all requests for files
in the Catalog directory to the NewCatalog directory, type
/NewCatalog.
IIS7: Configure the Web Server to Redirect Requests to an Exact Destination
Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
For information about navigating to locations in the UI based on your
IIS administrative role, see Navigation in IIS Manager (IIS 7).
In Features View, double-click HTTP Redirect.
On the HTTP Redirect page, under Redirect Behavior, select Redirect all requests to exact destination (instead of relative to
destination).
In the Actions pane, click Apply.

Related

How to Upload website over internet by using IIS and domain

Please Explain me step by Step, how to host a website over internet. by using iis server with help of domain
To host asp.net site in iis you could follow the below steps:
1)open the visual studio. Select your site and right-click on that-> Click publish.
2) in pick up publish target Select folder option and create choose destination where you want to publish the site. (make a new folder and publish a site in that folder) and then select publish.
3)open IIS manager(if not installed then installed it first).
4)expand the server name and right-click on sites and select add a new site.
5)enter the site name, physical path, and site binding details.
(Note: you need to have a public IP first, and bind the domain to the IP at where you purchased the domain name. after that, in IIS, bind IP and hostname as usual)
6) click ok.
if you have url rewrite rule and other external settings in your site you need to install that external module in iis.
for more detail please check the below link:
https://learn.microsoft.com/en-us/iis/install/installing-iis-7/installing-iis-7-and-above-on-windows-server-2008-or-windows-server-2008-r2

IIS redirection to external web site

Is it possible to create local web site in local IIS with some domain, for example. dummy-website
and when locally enter that domain to be redirected to some other web site in internet, note that after redirection url need to stay dummy-website, content of web site from internet needs to be displayed in requested local domain.
Tnx
yes there is:
In IIS Manager, expand the local computer, right-click the Web site or directory you want to redirect, and click Properties.
Click the Home Directory, Virtual Directory, or Directory tab.
Under The content for this source should come from, click A redirection to a URL.
In the Redirect to box, type the URL of the destination directory or Web site. For example, to redirect all requests for files in the Catalog directory to the NewCatalog directory, type /NewCatalog.
and there you go!
Hope this helps.

Installing .net site locally results in "This page can't be displayed"

I've received some files for a site I'd like to update and am trying to get it running in IIS locally. IIS is working - if I go to http://localhost I get the index.htm file - but if I go to http://localhost/aspxsite/ (their files) I get "This page can't be displayed".
I'm very unfamiliar with this stuff - any suggestions would be appreciated.
I'm running IIS 7.5.7600.16385 on Windows 7 Pro.
1.Open IIS Manager.
In the Connections pane, right-click the Sites node in the tree, and then click Add Web Site.
3.In the Physical path box, type the physical path of the Web site's folder, or click the browse button (...) to navigate the file system to find the folder.
Go to C:\Windows\System32\drivers\etc\hosts.txt and add this line:
127.0.0.1 aspxSiteName
Type in browser http://aspxSiteName

How to redirect a binding in IIS 7.5 (Windows 2008 R2)?

I have a "Default Web Site" with different apps under it... I have setup a HOST (A) record for a DNS name "support.mydomain.com" which points to the IIS server.
In the IIS bindings, i have configured the new HOST (A) record binding, what I would like to do is redirect any requests going to support.mydomain.com to a folder under my "Default Web Site" wwwroot.
As shown in the pictures, I'd like to redirect anything going to support.mydomain.com to the Default Web Site > App > SI folder.
Right now, it shows the standard IIS7 "welcome" page which is at the root (Default Web Site).
Any ideas?
Thank you.
You will need to use IIS URL Rewrite module for this.
http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module

IIS Default Redirect

In IIS7, if the default redirect at the website level is a relative path, how to make the default redirect is on https and not http.
Currently if the host is: abc.com and the login page is abc.com/myapp/login.aspx, I set the default redirect (IIS manager -> HTTPRedirect) to /myapp/login.aspx. So, if the user enters abc.com in his browser address bar, he gets redirected to http://abc.com/myapp/login.aspx. I want to make sure the user gets redirected to http*s*://abc.com/myapp/login.aspx.
Would it need a web.config at the root level?
Note that this cannot be done in asp.net code, because the asp.net code is not involved in the processing of this request
Edit:
One way to do it is having a "default" web app i.e. web app deployed at the root (web site) level and then use the standard redirection module available with asp.net. Any thoughts on pros, cons?
Finally we came up with 3 different options:
Use an index.htm at the "Web Site" level and put a javascript that would set the
window.location.href to the https URL.
Use the IIS URL rewrite module
Use a custom asp.net module to do the redirection to a https URL. The dll for this module will be registered in GAC and the module configured at the "Web Site" level. The registration in GAC is necessary because the module will be invoked for the child applications of the "Web Site"
The option 3 was selected based on :
Ease of Deployment. Installing the rewrite module on all the front end servers is more complex than installing a dll in GAC
Support for non-browser User Agents that will not parse the javascript. This eliminates option 1.

Resources