P
P
Pablos252018-12-05 20:46:57
htaccess
Pablos25, 2018-12-05 20:46:57

Wordpress 301 redirect when changing permalinks to /%category%/%postname%/?

Hello.
I change the structure of permalinks from "Post
name" host.ru/sample-post
to "Random" http://host.ru/%category%/%postname%/
WordPress does not automatically pick up the redirect (and tried to change it back - redirect)
I guess that you can set up a 301 redirect in .htaccess with a couple of lines.
I myself am a handyman, I ask for help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
Zettabyte, 2018-12-05
@Zettabyte

WordPress does not automatically pick up the redirect

Are you 100% sure that he should? I read that it seems to be yes, but I did not have the opportunity to verify the correctness of the work.
The only time I did a URL change like this was when I had entries in them %id%, so you could do almost anything.
I guess that you can set up a 301 redirect in .htaccess with a couple of lines.

I will not deny with certainty, but I will say that it is likely that it is not. Imagine 100 posts with URLs like /mama-myla-ramu, /ograblyaem-korovanyetc. How do you configure all of them to match new URLs like /home/chisto-v-dome-chisto-v-dusheand in a couple of lines /money/nachni-svoy-biznes?
And in general, I suspect that everything is in order in .htaccess, because beautiful URLs work.
Take a look at the Redirection by John Godley plugin, maybe it will be useful in your situation.
And also look at the server responses in the headers when redirects don't work - the probability is low, but there may be additional useful information there.

V
Vova, 2018-12-11
@vova87

Try after changing the permalink settings, resave the posts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question