B
B
bigQQ2021-02-06 03:36:03
htaccess
bigQQ, 2021-02-06 03:36:03

How to redirect via .htaccess subdomain from www to subdomain without www?

How to redirect via .htaccess subdomain from www to subdomain without www, which in turn is redirected to another page.
Example:
the site is located on the server in the folder domen.ru
There is a redirection of poddomen.domen.ru to domen.ru/poddomen.html (works with .htaccess)

Question: how to make the www.poddomen.domen.ru link work? (it does not open now, it is necessary that in the end from this address there should be a redirect to domen.ru/poddomen.html Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-02-08
@bigQQ

RewriteCond %{HTTP_HOST} ^(.+)\.example\.ru$
RewriteCond %{HTTP_HOST} ^!www\.example\.ru$
RewriteRule ^$ http://example.ru/%1/.html [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question