Why RewriteRule causes an unwanted redirection?

0 like 0 dislike
126 views
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?
5c5b06293f5e8707595830.png
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.
by

Related questions

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