diff --git a/public/index.html b/public/index.html
index 1abf8ae..40fbaa0 100644
--- a/public/index.html
+++ b/public/index.html
@@ -743,10 +743,7 @@ img { max-width: 100%; display: block; }
-
-
Демонтаж трубопроводов и утилизация отходов по всей России
-
-
+
diff --git a/server.js b/server.js
index 3871933..81d6748 100644
--- a/server.js
+++ b/server.js
@@ -6,6 +6,29 @@ const sharp = require('sharp');
require('dotenv').config();
const app = express();
+
+app.use((req, res, next) => {
+ const proto = req.headers['x-forwarded-proto'];
+ if (proto && proto !== 'https') {
+ return res.redirect(301, 'https://' + req.headers.host + req.url);
+ }
+ next();
+});
+
+app.use((req, res, next) => {
+ const host = req.hostname;
+ if (host.startsWith('www.')) {
+ const target = host.replace(/^www\./, '');
+ return res.redirect(301, 'https://' + target + req.originalUrl);
+ }
+ next();
+});
+
+app.use((req, res, next) => {
+ res.setHeader('Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload');
+ next();
+});
+
const PORT = process.env.PORT || 3000;
const API_KEY = process.env.HOTEL777KEY;
if (!API_KEY) {