W
W
wagwandude2017-08-24 15:45:08
htaccess
wagwandude, 2017-08-24 15:45:08

How to make the correct Redirect 301?

Hello.
I am transferring a table with articles from the database of the old site to the new site. However, links that are indexed by search engines (~5,000 posts) are located at a slightly different address than on the new engine.
I read that you can make 301 redirects and over time everything will be reindexed with new links.
Tell me how to make a 301 redirect from these links:

https://site.ru/5458-zabavnaya-reklama-ne-teryaet-aktualnosti.html

to these:
https://site.ru/journal/zabavnaya-reklama-ne-teryaet-aktualnosti

Many thanks in advance for your help!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2017-08-24
@wagwandude

Of course, you will forgive me, but you do not have a direct connection in the links.
At least throw off the Excel file.
Here is your example
But I assume that you need to remove all the numbers and instead write a journal
and remove the html

RewriteRule ^[0-9]{1,}\-(.+)\.html$ /journal/$1? [L,R=301]

tsfirf from 0-9 at least 1 time to -further (here is your url) to .html the end, we substitute what is in brackets in ur

V
Vovanys, 2017-08-24
@Vovanys

nginx + regular expressions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question