zoukankan      html  css  js  c++  java
  • 2018-10-07

    1>使用core来构建一个简单的web系统.

    2>加入了Microsoft.AspNetCore.Rewrite,来对url进行重写。

    3>第一次使用ViewComponent,有点像ascx的感觉。

    4>设计思路

    菜单 Rewrite 来重写

    菜单 ViewComponent来生成。

    QQ,二维码这些,我要报名,还是用部分视图来处理吧。

    类别1/明细

    类别2/明细

    新闻/明细

    像这样来吧。

    继续前进。完成更多的。比完美更重要。要记得。

    要点

    RewriteOptions 从数据库读取数据?

    容易控制,想怎么来就怎么来。会不会有性能问题?

    还是使用iis的重写?

    参考 https://www.cnblogs.com/yanzhen/archive/2012/01/07/iis7-wei-jing-tai.html

    <?xml version="1.0"?>

    <configuration>
    <system.webServer>
            <rewrite>
                <rules>
                    <!--301重定向把不带3W的域名 定向到带3W-->
                    <rule name="Redirect" stopProcessing="true">
                        <match url=".*" />
                        <conditions>
                            <add input="{HTTP_HOST}" pattern="^haoxinwen.info$" />
                        </conditions>
                        <action type="Redirect" url="http://www.haoxinwen.info/{R:0}" redirectType="Permanent" />
                    </rule>
                    <!--首页-->
                    <rule name="rD">
                        <match url="^$" />
                        <action type="Rewrite" url="Default.aspx" />
                    </rule>
                    <!--产品列表-->
                    <rule name="rP">
                        <match url="^product/$" />
                        <action type="Rewrite" url="ProductList.aspx" />
                    </rule>
                    <!--产品列表第几页-->
                    <rule name="rPL">
                        <match url="^product/list-([0-9]*).html$" />
                        <action type="Rewrite" url="ProductList.aspx?page={R:1}" />
                    </rule>                
                    <!--产品类别列表-->
                    <rule name="rPT">
                        <match url="^product/([A-Za-z0-9-]*)/$" />
                        <action type="Rewrite" url="ProductList.aspx?typeUrl={R:1}" />
                    </rule>
                    <!--产品类别列表第几页-->
                    <rule name="rPTL2">
                        <match url="^product/([A-Za-z0-9-]*)/list-([0-9]*).html$" />
                        <action type="Rewrite" url="ProductList.aspx?typeUrl={R:1}&amp;page={R:2}" />
                    </rule>
                    <!--产品详细-->
                    <rule name="rPd">
                        <match url="^product/([A-Za-z0-9-]*)/([A-Za-z0-9-]+).html$" />
                        <action type="Rewrite" url="ProductDetail.aspx?typeUrl={R:1}&amp;url={R:2}" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
  • 相关阅读:
    PHP数组(数组正则表达式、数组、预定义数组)
    面向对象。OOP三大特征:封装,继承,多态。 这个讲的是【封存】
    uvalive 3938 "Ray, Pass me the dishes!" 线段树 区间合并
    LA4329 Ping pong 树状数组
    HDU 1257 最少拦截系统
    HDU 1260 Tickets
    codeforce 621D
    codeforce 621C Wet Shark and Flowers
    codeforce 621B Wet Shark and Bishops
    codeforce 621A Wet Shark and Odd and Even
  • 原文地址:https://www.cnblogs.com/forhell/p/9750693.html
Copyright © 2011-2022 走看看