D
D
Dmitry Bezverkhy2016-09-13 13:05:17
Domain name market
Dmitry Bezverkhy, 2016-09-13 13:05:17

For multiple domains, redirect to https without WWW?

The client likes to buy similar domains, and in order not to climb into htaccess every time, they made such

Purchased domains site1.ru, site2.ru, site3.ru...site20.ru

### Начало переадресация на site.ru
RewriteCond %{HTTP_HOST} ^www\.(.*) [OR]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://site.ru/$1 [R=301,L]
### Конец


Everything works well, redirects all pages to the main domain, but the Link

of the form:
site1.ru/files/img/letter.jpg
does not redirect , it just remains the same.

Although from a link
like:
site1.ru/files/img/letter.html
site1.ru/files/img/letter
site1.ru/files/img/letterjpg

redirects as expected to

site.ru/files/img/letter.html
site .ru/files/img/letter
site.ru/files/img/letterjpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2016-09-16
@llgruff

Dmitry Bezverkhy most likely gives the statics to Nginx
Write to the hoster, they will tell you if it is possible to reconfigure the server configuration

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question