diff --git a/nginx.conf b/nginx.conf index c607e7b..21d1ab6 100644 --- a/nginx.conf +++ b/nginx.conf @@ -10,9 +10,14 @@ server { try_files $uri $uri.html $uri/ =404; } - # Optional: Redirect .html URLs to clean URLs - if ($request_uri ~ ^/(.*)\.html(\?|$)) { - return 301 /$1$2; + # Don't redirect mobile.html to allow device-specific routing + # Skip the .html redirect for mobile.html and index.html + location = /mobile.html { + try_files /mobile.html =404; + } + + location = /index.html { + try_files /index.html =404; } # Gzip compression for better performance