Problems Redirecting Group of Pages in Wordpress
-
This post is deleted! -
Could it have crashed the site because the .htaccess code was invalid? .htaccess can be tricky. I usually recommend using the 301 feature in Yoast SEO or installing Simple 301 Redirects, just to keep out of .htaccess.
http://www.baghouse.com/products/dust-collector-filters did throw a 404.
http://www.baghouse.com/products/dust-collector-filters/baghouse-filter threw a 301 to http://www.baghouse.com/products/baghouse-filters/
It seems like there's some confusion on what's throwing which status code - I would do the following after you're done your changes:
- Clear the 404 errors in search console
- Run a screaming frog crawl and export the 404's
- 301 accordingly, maybe not using .htaccess depending on your comfort level (or use the options I listed above)
- Redo this in a few weeks, but look at the 404's in Search Console this time (as Google tends to find additional 404's - by clearing the 404's in step one, it's easy to see what the new 404's are)
Hope that helps. It's my usual process and seems to work well.
-
I double checked the syntax on them and they were correct.
Well it seems that products/dust-collector-filters did throw a 404 but products/dust-collector-filters/ was properly redirected without a problem. It looks like its properly done with a 301.
What I don't understand here is that it seems to be doing all of this automatically, without me doing anything. I only added two 301s to the htaccess and yet everything is redirecting. Is there some built in feature to wordpress that does this when you change the URL on existing pages? OR maybe some plugin I have?
-
This post is deleted! -
Yes - if you change a URL directly in the page editor, Wordpress will do the 301 for you.
-
You'd think I would know that...
That would explain whats going on.How does Wordpress do the 301s in this way? Does it do some kind of coding engine to redirect it? (just curious)
So in that case, when I changed the main page URL (/products/dust-collector-filters to /products/baghouse-filters it automatically changed all the lower pages and put 301s on all of them. Is that correct?
So I guess I should just leave it and check on it again in a week or so and make sure everything is ok.
-
You got it. Change the parent URL and the child pages' URLs will change accordingly (with 301s as well).