L
L
linuxnb2018-04-04 09:16:23
htaccess
linuxnb, 2018-04-04 09:16:23

How to redirect from a subdomain to a link (.htaccess)?

Good time of the day
Such a question:
You need to do a redirect using .htaccess
, for example, there is a site example.com (on the hosting there is only 1 folder with the name of the site, there are no others)
The user makes a request help.example.com, but in fact that he would get to example.com/page.php?tag=help
and it is not known in advance which subdomain the user will knock on.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2018-04-04
@shambler81

RewriteCond %{HTTP_HOST} ^help\.example\.com$
RewriteRule ^.*$ http://example.com/page.php\?tag=help [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question