K
K
kotov8652021-12-16 20:13:14
htaccess
kotov865, 2021-12-16 20:13:14

How to redirect from a subdomain to a directory with saving parameters?

It is required to redirect from the test.site.com domain to the directory of another domain example.com/test with all parameters saved.
Example:
test.site.com/news -> example.com/test/news
test.site.com/profile?show=edit -> example.com/test/profile?show=edit

What is the correct way to setup .htaccess for this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Immortal_pony, 2021-12-16
@kotov865

RewriteRule ^ https://example.com/test%{REQUEST_URI} [END,NE,R=permanent]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question