Diễn đàn    Các Projects Dotnetnuke (DNN)    Lỗi 404 trên DNN sử dụng aspnet v40 và Extensionless Url Intergrade

Thành viênTrả lời
tieuphu

Thống chế Erich von Manstein
51  bài
19-11-2018 18:8:50
Một lỗi rất khó chịu nếu bạn dùng Win Server 2008 cũ và chỉ có IIS 7.0 chứ không có IIS 8+. Với các phiên bản từ IIS 8 cho Windows server 2012 thì không có lỗi này.

Mất vài giờ để tìm kiếm thì ra cái sau :
https://blogs.msdn.microsoft.com/tmarq/2010/05/26/how-extensionless-urls-are-handled-by-asp-net-v4/

Cơ chế hoạt động của Extensionless trên Dotnetnuke 7.2, 8.x, 9.x thế nào ?
Trong DNN bạn có thể tìm thấy trong web.config như sau :

name="ExtensionlessUrl-Integrated-4.0"
path="*." verb="GET,HEAD,POST,DEBUG"
type="System.Web.Handlers.TransferRequestHandler"
preCondition="integratedMode,runtimeVersionv4.0" />

By default, the root web.config file contains a path="*" mapping to DefaultHttpHandler. In integrated mode they are mapped to TransferRequestHandler. DefaultHttpHandler and TransferRequestHandler are similar in what they do. If you do not remap the handler, they will both issue a "child request" to the original URL, but ask IIS to ignore their handler mappings for this second request. By default, the IIS StaticFile handler is what will be mapped to these URLs during the second request, and that will typically result in a 404 or 403, assuming that no such file or directory exists.

Mặc định integrated mode sẽ gửi yêu cầu đến TransferRequestHandler, DefaultHttpHandler và TransferRequestHandler sẽ làm nhiệm vụ UrlRewrite. Các file tĩnh (StaticFile handler) có thể phát sinh lỗi 404 hoặc 403.

Tóm lại để Rewrite Url hoạt động chỉ cần cài thêm cái bản Fix
See KB 980368 for more information
link đây : https://support.microsoft.com/en-us/help/980368/a-update-is-available-that-enables-certain-iis-7-0-or-iis-7-5-handlers

Cài lên restart server là xong.

Giờ thì URL không đuôi .aspx hay extensionless đã chạy.
---
Miệt mài, miệt mài ...
http://awas.vn
 

Chủ đề gần đây :

Cùng loại :

Tên file Mô tả chi tiết Ngày
NWeb.zip (1) Module đơn giản Newsweb trên Dotnetnuke v10.x.x.x10/18/2025 8:08:11 AM
vspforum.zip (11) Ma nguon vspforum ngay xua4/18/2023 6:38:37 AM
pdfjs.rar (2) pdfjs 2017 : hiển thị tốt trên iphone 11, 12, 13 không lỗi, bản 2012 sẽ lỗi trên iphone6/21/2022 11:52:48 AM
pdfjs2.rar (2) Xem file pdf bằng viewer.hml cua pdfjs (thư viện chuẩn mozilla) 2012. https://mozilla.github.io/pdf.js/getting_started/#download có thể download bản prebuild tại đây6/21/2022 11:52:04 AM
runner.zip (0) using three.js, orbitcontrol to view an object move random on map. Di chuyển 1 đồ vật ngẫu nhiên trên bản đồ, sử dụng với demo nhân viên di chuyển trong văn phòng. Toàn js download về là chạy12/5/2019 5:55:14 PM
gmap.zip (1) google map + marker7/17/2019 2:25:05 PM
vinsmarthomeservice.zip (1) java post json to api, use AsyncTask, event listener7/9/2019 5:00:10 PM
fblogin.zip (0) Login facebook bang javascript SDK7/9/2019 9:16:37 AM
autocomplete-location.zip (2) autocomplete location geo from google place, html + js7/4/2019 4:37:55 PM
WebAPI.zip (8) api for android access db (v1.0.0)7/4/2019 9:14:17 AM