Strip trailing .html extensions from URLs so that existing bookmarks work for a legacy site ported to Django
1) You've ported an existing web site to Django. 2) The new site URLs don't have html (or htm) extensions. 3) The old site had URLs with html extensions. 4) You want existing bookmarks to work. Use this middleware to removes trailing .htm and .html extensions from incoming URLs (GETs only) so that your new site honors existing bookmarks. Locate it in settings.MIDDLEWARE_CLASSES near CommonMiddleware because it has similar middleware stack location requirements. If an incoming URL has an html extension, ZapDotHtmlMiddleware strips it out and redirects.
- middleware
- url_rewrite
- strip_dot_html_from_urls