Why RewriteRule causes an unwanted redirection?

0 like 0 dislike
I would want that when the page is requested domen.ru/old/***/ the page that opens domen.ru/new/***/ but the url was still the old name.
htaccеss looks like this:
RewriteEngine On RewriteRule ^old/([a-zA-Z]+)/$ https://%{HTTP_HOST}/new/$1/ [L] # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress

When you open pages view domen.ru/old/primer/ 302 redirect is happening, which I don't need. Why?
by | 126 views

1 Answer

0 like 0 dislike
[R=301,L] add at the end will be 301й
And regarding the topic itself, it's not real - htaccess redirects requests if you want to open other pages, then you need to edit your php.

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
5 answers
110,608 questions
257,187 answers
40,796 users