I am trying to correct a problem on a WordPress site which is producing duplicate pages in the format of:
/about-us/connecticut/3/3
/about-us/connecticut/3/3
/about-us/connecticut/3/
/about-us/connecticut/3
/about-us/connecticut/
I cannot determine what is causing this to happen.
Can anyone suggest ways to stop this from happening?
Thanks,
Josh
You could try adding this above your wordpress rules in your .htaccess:
It isn’t very useful, but that could be a good thing. It would redirect any grandchild of the about-us directory that is only numbers to its parent page (child of about-us).
This one is universal. In my limited testing it works great to remove any numbers at the end of a url. It would make is so that you could never name a page using only numbers. any page would need to have letters in it as well.
That one will most likely have unforeseen consequences, so if you use it, just keep it in mind anytime you have to troubleshoot some strange behavior…
You could also limit any of these to only redirect a single hanging digit instead of any number of hanging digits by changing:
to:
Hope that helps…