cooperative-software-develo.../.htaccess

23 lines
671 B
ApacheConf
Raw Normal View History

2023-02-11 23:03:39 +01:00
RewriteEngine On
# Set the path to prepend to all rewrites.
2023-02-11 23:03:39 +01:00
2021-12-31 23:23:39 +01:00
RewriteBase /ajko/books/cooperative-software-development
2023-02-21 02:25:06 +01:00
# Define missing mjs MIME type.
AddType application/javascript .mjs
2023-02-11 23:03:39 +01:00
# Remove the ending trailing slash from any requests to avoid resolving to directory listings
RewriteRule ^(.*)/$ $1.html
# Append .html to any requests with or without a trailing slash that resolve to a file with .html.
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [L,QSA]
# If we're processing a path that isn't a file or a directory, rewrite to index but preserve the query string.
RewriteCond %{REQUEST_FILENAME} !-f
2023-02-21 02:25:06 +01:00
RewriteRule (.*) 404.html [L,QSA]