diff --git a/Jenkinsfile b/Jenkinsfile index a87dafd..9513ce3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -118,9 +118,4 @@ pipeline { } } - post { - always { - cleanWs() - } - } } \ No newline at end of file diff --git a/src/sites/cryptograss.live/templates/shared/.htaccess b/src/sites/cryptograss.live/templates/shared/.htaccess new file mode 100644 index 0000000..e047212 --- /dev/null +++ b/src/sites/cryptograss.live/templates/shared/.htaccess @@ -0,0 +1,18 @@ +# Disable the automatic trailing slash addition by mod_dir +DirectorySlash Off + +# Enable the RewriteEngine +RewriteEngine On + +# Rule 1: Serve any URL without .html by appending .html if the corresponding .html file exists +RewriteCond %{REQUEST_FILENAME}\.html -f +RewriteRule ^(.*[^/])$ $1.html [L] + +# Rule 2: Allow requests to existing directories and files without .html to proceed as normal +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^ - [L] + +# Redirect .html URLs to the clean version +RewriteCond %{THE_REQUEST} \s(.+)\.html\s [NC] +RewriteRule ^(.*)\.html$ /$1 [R=301,L] \ No newline at end of file