@
@
@coderiter2020-03-12 16:35:29
Apache HTTP Server
@coderiter, 2020-03-12 16:35:29

How to make any subdomain of a site a mirror of a specific page?

Good afternoon! Now, when you open a subdomain, a full mirror of the current site opens, i.e. site.ru and some.site.ru are identical. The task is to make it so that when any subdomain is opened, the page of the main site site.ru/landing is displayed without a redirect to it, i.e. on the subdomain page.

And an additional question, how to redirect all possible addresses of any subdomains to the main page of these subdomains - i.e. how to make some.site.ru/page1203 redirect to some.site.ru, and the rules from point 1 already worked there.

There will be many subdomains and their names are not known in advance.
.htaccess is now standard WordPress.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-03-12
@shambler81

create a separate site with a root document in the /landing folder and that's it

RewriteCond %{HTTP_HOST} ^some\.site\.ru$
RewriteRule ^page1203$ https://ome.site.ru/? [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question