WP didn't redirect to canonical category URL
I have a problem with canonical redirect.
mydomain.com/mycat is the correct category URL but the following URL works too: - mydomain.com/asdfa/mycat - mydomain.com/1234/mycat - mydomain.com/anythingyouwant/mycat
And all these URLs show the category mycat... The canonical is mydomain.com/mycat and now Google give results with bad URLs.
Can you please help me because I didn't understand why.
I have the same template on other website and when we try to go to mydomain.com/asdfa/mycat, WP redirect to the canonical URL mydomain.com/mycat
Topic rel-canonical wp-redirect categories redirect themes Wordpress
Category Web