伪静态设置及伪静态与静态区别个人看法

代码
<?xml version="1.0"?>
<!--
注意: 除了手动编辑此文件以外,您还可以使用
Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
“网站”
->“Asp.Net 配置”选项。
设置和注释的完整列表在
machine.config.comments 中,该文件通常位于
\Windows\Microsoft.Net\Framework\v2.x\Config 中
-->
<configuration>
<!-- 手动添加 -->
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
<!-- 手动添加 -->

<appSettings>
<add key="SQLCONNECTIONSTRING" value="Data Source=.;Initial Catalog=site160;User ID=sa;pwd=lilo202"></add>
<add key="FCKeditor:BasePath" value="~/fckeditor/"/>
<add key="FCKeditor:UserFilesPath" value="/web/UploadFiles/"/>
</appSettings>
<connectionStrings/>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/about.html</LookFor>
<SendTo>~/about.aspx</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/list_(\d{1,6})\.html</LookFor>
<SendTo>~/list.aspx?page=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/product.html</LookFor>
<SendTo>~/product.aspx</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/Contact.html</LookFor>
<SendTo>~/Contact.aspx</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/job.html</LookFor>
<SendTo>~/job.aspx</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/serviceaim.html</LookFor>
<SendTo>~/serviceaim.aspx</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/news.html</LookFor>
<SendTo>~/news.aspx</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<system.web>
<!--
设置 compilation debug
="true" 将调试符号插入
已编译的页面中。但由于这会
影响性能,因此只在开发过程中将此值
设置为
true
-->
<pages validateRequest="false"/>
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
通过
<authentication> 节可以配置 ASP.NET 使用的
安全身份验证模式,
以标识传入的用户。
-->
<authentication mode="Windows"/>
<!--<customErrors mode="On" defaultRedirect="errorip.htm"></customErrors>-->
<!--
如果在执行请求的过程中出现未处理的错误,
则通过
<customErrors> 节可以配置相应的处理步骤。具体说来,
开发人员通过该节可以配置
要显示的 html 错误页
以代替错误堆栈跟踪。


<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<!-- 手动添加 -->
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
validate
="false" />

<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter"/>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
</system.web>
</configuration>

这是web.config的配置,

还的引用这URLRewriter.dll这个方法

记的链接地址要改成了伪静态所设置好的页面,

已经成功……

1、使用真静态和假静态对SEO来说没有什么区别
  2、使用真静态可能将导致硬盘损坏并将影响论坛性能
  3、使用伪静态将占用一定量的CPU占有率,大量使用将导致CPU超负荷
  4、最重要的一点,我们要静态是为了SEO
  所以:
  1、使用真静态的方法可以直接排除了,因为无论怎么生成,对硬盘来说都是很伤的。
  2、既然真伪静态的效果一样,我们就可以选择伪静态了。
  3、但是伪静态大量使用会照成CPU超负荷。
  4、所以我们只要不大量使用就可以了。
  5、既然静态只是给SEO看的,我们只需要伪静态给SEO就行了,不需要给用户使用。
  6、所以我们只要在专门提供给SEO爬的Archiver中使用伪静态就可以了。

原文地址:https://www.cnblogs.com/lilo202/p/1756886.html