Answer the question
In order to leave comments, you need to log in
How to redirect to a new domain while keeping the paths after the slash?
Hello.
I need to set up a redirect from the old domain to the new one, but in such a way that the path after the slash is preserved, for example: the old domain is example.ru, the new one is example.com. The user requests the page example.ru/?p=101 and is redirected to example.com/?p=101, not to example.com.
PS Site on WordPress.
Answer the question
In order to leave comments, you need to log in
For apache in htaccess
RewriteEngine on
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
On the hosting of the old domain, make a .htaccess file with the following content:
Don't forget to replace newdomain.com with your NEW domain.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question