Try this rule:
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [L]
This will rewrite all requests that can be mapped to an existing file when appending a .html
.
More Related Contents:
- Reference: mod_rewrite, URL rewriting and “pretty links” explained
- RewriteRule Last [L] flag not working?
- Rewriting an arbitrary number of path segments to query parameters
- .htaccess rewrite “/book.php?id=1234” to “/book/1234”
- How to rewrite URL without refresh, like GitHub.com
- RewriteCond to match query string parameters in any order
- URL rewriting for different protocols in .htaccess
- Apache rewrite rules not being applied for angularjs
- The Redirection of Multiple Parked Domains doesn’t Work with Filename [closed]
- Remove .php extension with .htaccess
- htaccess remove index.php from url
- How to do URL re-writing in PHP?
- URL rewriting : css, js, and images not loading
- What does RewriteBase do and how to use it?
- Remove .php from urls with htaccess
- Mod_Rewrite unexpected behavior L flag
- How to redirect non-www to www URL’s using htaccess?
- How to encode special characters using mod_rewrite & Apache?
- Redirect to Apache built-in 404 page with mod_rewrite?
- htaccess 301 redirect – Remove query string (QSA)
- mod_rewrite with anchor link
- mod_rewrite: remove query string from URL?
- Redirect requests only if the file is not found?
- Pretty URLs in PHP frameworks
- Multiple RewriteRules for single RewriteCond in .htaccess
- .htaccess 301 redirect for all https to http EXCEPT ONE PAGE
- Difference between $1 vs %1 in .htaccess
- RewriteRule checking file in rewriten file path exists
- Set RewriteBase to the current folder path dynamically
- mod_rewrite urlencoding an already urlencoded query string parameter – any way to disable this?