L
L
leMar2013-07-24 18:41:28
WordPress
leMar, 2013-07-24 18:41:28

How to change the structure of permalinks so that the old links are not broken?

Now the structure is this: sitename.com/%id%
I want to change to another one, but so that old links can be opened. Is it possible?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
leMar, 2013-07-24
@leMar

Solution:
in .htaccess write RedirectMatch 301 ^/(\d+)$ sitename.com/?p= $1
regexp needs to be changed depending on your links. This particular one works for /%post_id%. For other formats, respectively - another.

R
Ruslan, 2013-07-24
@rOOse

There is a plugin that you set old and new permalinks and it will redirect from old links to new ones, like this one: wordpress.org/plugins/advanced-permalinks/

P
Puma Thailand, 2013-07-25
@opium

Well, write a simple script yourself that will generate redirects in htaccess
, nothing at all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question