J
J
Julia Reiner2017-02-17 12:33:33
Apache HTTP Server
Julia Reiner, 2017-02-17 12:33:33

How to make a 301 redirect from a subdomain to a website page?

There is a test.site.com domain, you need to make a 301 redirect to site.com/test
Option
RewriteCond %{HTTP_HOST} ^test.site.com$ [NC]
RewriteRule ^(.*)$ site.com/test$1 [R=301 ,L]
Doesn't work.
Similar. like
RewriteCond %{HTTP_HOST} ^category\.example\.com [OR]
RewriteCond %{HTTP_HOST} ^category\.example\.com
RewriteRule ^(.*)$ example.com/category/$1 [L,R= 301]
What other options are there?
Joomla main site, html subdomains

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-02-17
@SandFox0

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

will go?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question