网站路径问题 [英] website path problem

查看:49
本文介绍了网站路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net中创建了许多Web应用程序.我通过IIS在本地服务器(操作系统类型-windows server 2008)中发布了所有项目.我在属性中分配了网站名称,例如dev.sampleproject.com.完成所有工作后,我在浏览器中提供dev.sampleproject.com,它将无法打开应用程序,它将转到google search.but我提供服务器IP地址(例如233.23.23.233/1000/home.aspx)它将打开.

我不知道在IIS中创建新网站时在哪里出错了.




请帮助我...

i am created many web application in asp.net. i published all the project in my local server (OS type -windows server 2008)through IIS. i am assigning website name like dev.sampleproject.com in the properties. After all work done i am giving dev.sampleproject.com in the browser it will not open the application,it will go to google search.But i am giving with server ip address (for example 233.23.23.233/1000/home.aspx) it will open.

I don''t know Where i did the mistake while creating new website in IIS.




Please Help me......

推荐答案

问题是,即使您在本地IIS中发布了站点,您的计算机仍然不知道IP与名称"dev.sampleproject.com"相对应的地址.您的浏览器尝试解析该名称,但DNS服务器显然对此一无所知,并且此信息没有本地来源.

为了使仅知道其名称的任何人都可以使用您的网站,您需要在DNS服务器上注册您的网站,以便当有人尝试访问"dev.sampleproject.com"时,该名称将在您的IP地址中解析.
但是,正如我怀疑的那样,您只想在本地环境中测试您的站点.这很容易实现:Windows在
The problem is even after you published your site in your local IIS, your computer still doesn''t know the IP address corresponding to name "dev.sampleproject.com". Your browser tries to resolve the name, but DNS server obviously knows nothing about it, and there''s no local source of this information.

In order to make your site availabe to anyone who knows just its name you need to register your site with DNS server, so that when someone attempts to reach "dev.sampleproject.com" this name gets resolved in your IP address.
But, as I suspect, you only want to test your site in your local environment. This is quite simple to achieve: Windows has a file named "hosts", located at
%WINDIR%\System32\drivers\etc

目录中有一个名为主机"的文件,其中包含"IP地址-符号名称"对.这些记录也被OS用来将符号资源名称解析为IP地址(据我所知,甚至在请求DNS服务器之前都会对其进行检查).因此,如果要将对dev.sampleproject.com的所有请求发送到您自己的计算机,请打开此文件并添加新记录:

directory, that contains pairs "IP address - symbolic name". These records are also used by OS to resolve symbolic resource name to an IP address (as far as I know, it is checked even before request to DNS server). So, if you want all your requests to dev.sampleproject.com to be sent to your own machine, open this file and add new record:

[your IP]	dev.sampleproject.com

,例如:

233.23.23.233	dev.sampleproject.com


这篇关于网站路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆