Chuyển đuôi .aspx sang .html trong Kentico

By THV / 08:53 | 27/08/2014
Chuyển đổi đuôi mở rộng trong kentico. Chuyển đổi từ .aspx (default) sang đuôi .html
Bước 1 : Chuyển tất cả mã .aspx trong code behind sang .html

Bước 2 : truy cập vào CMSSiteManage -> Settings -> URLs and SEO :
Friendly URL extensions : (chuyển đổi .aspx -> .html)

Bước 3 :

Thêm mã runAllManagedModulesForAllRequests="true" sau vào web.config
<system.webServer>
……..
   <modules runAllManagedModulesForAllRequests="true">
      <remove name="WebDAVModule" />
      <remove name="XHtmlModule" />
      <remove name="CMSApplicationModule" />
      <remove name="UrlRoutingModule" />
      <add name ="CmsPatchModule" type ="CMS.Patch.CmsPatchModule,CMS.Patch"/>
      <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      ………………………………
    </modules>
……………………..   
  </system.webServer>

Lưu ý: Nếu server IIS 6 thì cần cấu hình lại trong IIS như sau (từ IIS 7 trở lên không cần thực hiện bước này):

Đối với iis 6 :

iis_static1.png

Click vào tab Home Directory và click "Configuration" .

iis_static2.png


click "Insert" (chú ý:  đừng click vào "Add")

iis_static3.png

Nhập đường dẫn tới file ISAPI dll. Nếu bạn sử dụng .NET 2.0 cho website hiện tại thì bạn cần bỏ check " Verify that file exists ": C:\windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

Nếu bạn sử dụng .NET 4.0 cho website, thì bạn check vào "Verify that file exists".

-> click OK.


iis_static4.png

Chúc các bạn thành công.