S
S
Sergey2020-09-22 12:33:26
htaccess
Sergey, 2020-09-22 12:33:26

How to redirect https://www.site.by to https://site.by and all pages?

How to redirect https://www.site.by to https://site.by and all pages?

when you enter www.site.by, it redirects to https://site.by
, but
if you type https://www.site.by , then nothing happens and pages also add www, it will not redirect

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
ge, 2020-09-22
@gedev

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.site\.by$ [NC]
RewriteRule ^(.*)$ https://site.by/$1 [R=301,L]
</IfModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question