Skip to content

Commit 9d98604

Browse files
committed
feat(htaccess): add HTTPS redirection and custom 404 handling
1 parent e5c558c commit 9d98604

File tree

4 files changed

+18
-34
lines changed

4 files changed

+18
-34
lines changed

nuxt.config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,6 @@ export default defineNuxtConfig({
151151
prefix: 'UI'
152152
}
153153
],
154-
nitro: {
155-
preset: 'netlify'
156-
},
157154
runtimeConfig: {
158155
public: {
159156
emailjs: {

public/.htaccess

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Use HTTPS canonical domain
2+
RewriteEngine On
3+
RewriteCond %{HTTPS} !=on [OR]
4+
RewriteCond %{HTTP_HOST} !^cris-dev\.com$ [NC]
5+
RewriteRule ^ https://cris-dev.com%{REQUEST_URI} [L,R=301]
6+
7+
# Block direct access to Nuxt build internals
8+
RewriteRule ^_(nuxt|i18n)/ - [F,L]
9+
10+
# Serve existing files and directories normally
11+
RewriteCond %{REQUEST_FILENAME} -f [OR]
12+
RewriteCond %{REQUEST_FILENAME} -d
13+
RewriteRule ^ - [L]
14+
15+
# Custom 404 page for unknown routes
16+
ErrorDocument 404 /404.html
17+
RewriteRule ^.*$ /404.html [L,R=404]
18+

public/_headers

Lines changed: 0 additions & 24 deletions
This file was deleted.

public/_redirects

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)