Answer the question
In order to leave comments, you need to log in
How to change the server header encoding when redirecting and return a 404 page without a redirect to https?
There is a virtual hosting on TimeWeb.
The htaccess file has a redirect from www to non-www, from http to https:
AddDefaultCharset UTF-8
AddType 'text/html; charset=utf-8' .html .htm .shtml
# Перенаправление с www
RewriteCond %{HTTP_HOST} ^www.specpst\.com$ [NC]
RewriteRule ^(.*)$ https://specpst.com/$1 [R=301,L]
# Перенаправление с http на https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
...
# Перенаправляем в файл обработки URL
RewriteRule ^(.*)$ /template/urlrewrite.php [L,QSA]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question