V
V
Vyacheslav Belyaev2016-04-05 19:42:56
htaccess
Vyacheslav Belyaev, 2016-04-05 19:42:56

How to make a 301 redirect while keeping subdomains?

How to make a 301 redirect from podomen.site.ru to podomen.site.com the domain can be anything

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2016-04-05
@mytmid

RewriteEngine on
RewriteCond %{HTTP_HOST} ^podomen\.site\.ru [NC]
RewriteRule ^(.*)$ http://podomen.site.com/$1 [R=301,L]

...it's not clear what "a subdomain can be anything" means

V
Vlad Zhivotnev, 2016-04-06
@inkvizitor68sl

For nginx:

server {
listen 80;
server_name ~^(?<subdomainname>[a-z0-9\-]+)\.domain\.ru;
return 301 http://$subdomain.domain.com;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question