Skip to content

Commit

Permalink
Adding htaccess for cryptograss.live
Browse files Browse the repository at this point in the history
  • Loading branch information
jMyles committed Jan 25, 2025
1 parent ec26e06 commit cde8e6f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,4 @@ pipeline {
}
}

post {
always {
cleanWs()
}
}
}
18 changes: 18 additions & 0 deletions src/sites/cryptograss.live/templates/shared/.htaccess
Original file line number Diff line number Diff line change
@@ -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]

0 comments on commit cde8e6f

Please sign in to comment.