khalannz7
Hectopat
- Katılım
- 18 Ağustos 2022
- Mesajlar
- 858
- Çözümler
- 15
Merhaba, HTTPS yönlendirme, .html uzantısını kaldırma ve hata sayfalarının 404 sayfasına yönlendirilmesi için aşağıdaki kodu yazdım. Doğru mudur?
Kod:
RewriteEngine On.
RewriteCond %{HTTPS} off.
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]
ErrorDocument 400 /404.html
ErrorDocument 401 /404.html
ErrorDocument 403 /404.html
ErrorDocument 404 /404.html
ErrorDocument 500 /404.html
ErrorDocument 502 /404.html
ErrorDocument 503 /404.html
ErrorDocument 504 /404.html