admin管理员组

文章数量:1203209

I have a problem with canonical redirect.

mydomain/mycat is the correct category URL but the following URL works too: - mydomain/asdfa/mycat - mydomain/1234/mycat - mydomain/anythingyouwant/mycat

And all these URLs show the category mycat... The canonical is mydomain/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/asdfa/mycat, WP redirect to the canonical URL mydomain/mycat

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

Share Improve this question asked Aug 31, 2017 at 20:52 TekhouseTekhouse 111 bronze badge
Add a comment  | 

2 Answers 2

Reset to default 0

Check error logs - probably PHP sent some content to browser before WordPress tried redirection (and failed because headers was already sent).

Check if you don't have any ?> on the end of config, theme and plugins files, and ofc check if deactivating plugins and temporary changing theme to one of Twentys help, it could help you target problematic part.

Maybe this answer about canonical urls can help you. It won't tell you how to do the redirects, but it will solve the Google search engine problem.

本文标签: categoriesWP didn39t redirect to canonical category URL