S
S
soundie2022-01-17 10:48:36
htaccess
soundie, 2022-01-17 10:48:36

How to redirect a site section to the main site while saving parameters?

What magic should be written in .htaccess (or maybe configure Apache in some other way) so that when accessing the following URL (an asterisk means any sequence of characters, including a slash, etc.):

https://test.ru/somename/*

Data is loaded at the following address (all that same sequence of characters is preserved):

https://test.ru/*

But! It is important that the original URL does not change in the address bar of the browser.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2022-01-17
@shambler81

RewriteRule ^somename/(.*)$ /$1 [QSA,L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question