How to correctly change URL? Redirect old links to the new ones
-
A couple of years ago being in haste and without considering the issue with due attention, I created random permanent links /news/111%post_id%.html
Now articles at my website are displayed in the following way: mysite.com/news/11111385.html
It’s not a good-looking link.I would like to replace it with /%postname%-%post_id%.html to get mysite.com/primer-123.html
On the website there are 1300 pages, and other online resources cite most of them and provide hyperlinks to them. I do not want to redirect each page manually as it is quite a complicated and time-consuming task.
So my question is: how to replace the link correctly and redirect old articles to the new address, so that they would not be lost from the index and visitors from other websites would not stumble upon page 404?
Is it possible to automatically redirect all the news from /news/111%post_id%.html to /%postname%-%post_id%.html?
What should I write in .htaccess in this case?
RewriteEngine On
RewriteRule ……………WordPress version 4.6
- The topic ‘How to correctly change URL? Redirect old links to the new ones’ is closed to new replies.