Sonya* Posted June 3, 2019 Posted June 3, 2019 We have over 800 articles made with Pages. After upgrade from 3.4.X to 4.4.X IPS has changed the canonical URL of the articles. Old: http://example.com/database/category/article New: http://example.com/database/category/article/ But there is no redirect, both URLs serve the same content. We experience SEO difficulties serving same content under different URLs. How do we create a 301 redirect for the old URLs?
Adlago Posted June 3, 2019 Posted June 3, 2019 Add in your htaccess file this //301 Redirect Old File Redirect 301 http://example.com/database/category/article http://example.com/database/category/article/ or for nginx # nginx configuration location Old { rewrite ^(.*)$ File redirect; } location http://example.com/database/category/article { rewrite ^(.*)$ http://example.com/database/category/article/ redirect; }
Sonya* Posted June 3, 2019 Author Posted June 3, 2019 Will this add slash to the URL like:http://example.com/database/category/article?tab=comments as well? 15 minutes ago, Adlago said: Add in your htaccess file this for over 800 articles?
Adlago Posted June 3, 2019 Posted June 3, 2019 Try this //301 Redirect Old File Redirect 301 http://example.com/database/category/article?tab=comments http://example.com/database/category/article/?tab=comments
Sonya* Posted June 3, 2019 Author Posted June 3, 2019 1 minute ago, Adlago said: Try this We have over 800 articles in the database. And also old parameters like ?st=30 on the old links. We cannot do redirect on every single article with every single parameter as you suggest. There should be a common solution for all our articles URLs without parameters.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.