2023-02-11 23:03:39 +01:00
|
|
|
RewriteEngine On
|
|
|
|
|
2021-12-31 23:14:48 +01:00
|
|
|
# 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
|
2021-12-31 23:14:48 +01:00
|
|
|
|
2023-02-21 02:25:06 +01:00
|
|
|
# Define missing mjs MIME type.
|
|
|
|
AddType application/javascript .mjs
|
|
|
|
|
2023-11-18 19:13:28 +01:00
|
|
|
# Redirect paths with trailing slash to paths without, then stop.
|
|
|
|
RewriteRule ^(.*)/$ $1 [L,R=301]
|
2023-02-11 23:03:39 +01:00
|
|
|
|
2023-11-18 19:13:28 +01:00
|
|
|
# Does adding .html to any requests resolve to a file with .html? Serve that with the query string, then stop.
|
2023-02-11 23:03:39 +01:00
|
|
|
RewriteCond %{REQUEST_FILENAME}.html -f
|
|
|
|
RewriteRule ^(.*)$ $1.html [L,QSA]
|
|
|
|
|
2023-11-18 19:13:28 +01:00
|
|
|
# If the filename is not a file, rewrite to index but preserve the query string.
|
2021-12-31 23:14:48 +01:00
|
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
2023-11-18 19:13:28 +01:00
|
|
|
RewriteRule (.*) index.html [L,QSA]
|