.net 设置默认首页

解决方案一:设置默认首页

在 Web.config 文件中,加上红色字体间的内容

<configuration>

    <system.web>

        <compilation debug="true" targetFramework="4.5" />

        <httpRuntime targetFramework="4.5" />  

    </system.web>

    <!--设置连接字符串-->

      <connectionStrings>

          <add name="Mall" connectionString="server=.;database=Wen.Mall;uid=sa;pwd=123456"/>

      </connectionStrings>

    <!--设置连接字符串-->

    <!--设置默认首页-->

    <system.webServer>

        <defaultDocument>

           <files>

              <clear/>

              <add value="index.aspx"/>   <!--该页为首页-->

           </files>

        </defaultDocument>

    </system.webServer>

    <!--设置默认首页-->

</configuration>

  

原文地址:https://www.cnblogs.com/dongh/p/9365438.html

时间: 2024-07-29 08:42:59

.net 设置默认首页的相关文章

struts2设置默认首页

在默认情况下,我们一般希望.当我们在浏览器中输入127.0.0.1:8080/project_name时候跳到项目的首页,那么在struts中我们这么设置呢?光加上<default-action-ref name="user" />是不够的,由于struts2默认是index.jsp为首页,所以我们把index.jsp删除了即可了,struts2从web.xml中找到项目的入口index.jsp可是index.jsp不存在了,那么<default-action-ref

设置默认首页(七)

web.xml(注意:默认首页路径不以斜杠开头)   在tomcat服务器中设置起始页  

Apache中设置默认首页的方法

在你安装后的Apache目录下,有一个conf目录,在这个目录里,有一个"httpd.conf"文件.我们要做的,就是修改这个文件. 在这个文件里,凡是以"#"开头的每一行,都是无效的,如果你想让你的设置起作用,就要把行首的"#"去掉. 找到 DirectoryIndex  这段.把它改成DirectoryIndex  index.php index.Html index.html  这样,你的网站目录的默认首页是 index.php, 如果没有

IIS 设置默认首页静态页,无静态页,走路由

在Global.asax文件中添加 protected void Application_BeginRequest(Object sender, EventArgs e)         {             if (Context.Request.FilePath == "/") Context.RewritePath("index.html");         } 在访问www.test.com时有index.html就是index.html,没有时就自

spring mvc 设置设置默认首页的方式

背景: 项目使用springmvc管理请求,有一个小的需求,输入域名的时候自动进入某个页面(或者说自动发起某个请求). 过程: 1,首先想到 在web.xml中配置welcome-file-list的方式,在这里填入一个restful风格的地址后,访问域名发现没有跳转到目标页面(该方法失败) <web:welcome-file-list> <web:welcome-file>xx/xxx</web:welcome-file> </web:welcome-file-

MVC4.0 如何设置默认静态首页index.shtml

1.不启用二级域名情况下(www.xxx.com)下设置默认静态首页index.shtml 通过配置IIS的默认文档,设置默认首页地址 然后在MVC的路由中写入忽略默认路由代码 routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute(""); routes.MapRoute( name: "Default", url: "{controller}/{act

spring mvc3+默认首页设置问题

web.xml配置: <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> 不要设置为*.do之类,这样只会拦截.do后缀名文件,设置为/,可以拦截所有请求.可以单独给页面设置后缀.如下java代码 然后java代码: @Controller public class Index

discuz首页设置默认地址不带forum.php后缀的方法

最近在研究discuz,上传安装几部搞定,打开首页跳到含有"/forum.php"的网址,到管理中心改了好一会儿也没好.那么如何实现discuz首页设置不带forum.php后缀呢? 我们可以通过空间的控制面板来设置网站首页默认页.登陆空间控制面板,来修改默认页打开的顺序,如下图:

springboot2 设置系统访问的默认首页

@Configuration public class WebMvcConfig implements WebMvcConfigurer{ @Override public void addViewControllers(ViewControllerRegistry registry){ //设置系统访问的默认首页 registry.addViewController("/").setViewName("redirect:/app/login.html"); } }