Deminer84 Posted July 13, 2017 Share Posted July 13, 2017 Good morning, In the past I had an option "Redirect to the canonical URL" set to "302 Moved Temporarily (recommended while setting up your store)". Now I've set it to 301 Moved Permanently (recommended once you have gone live). From that moment, all different friendly URLs redirect to the proper one with 301. The problem is, all old redirects (many of them are important, like old categoriers etc) are still marked as 302. I don't really want to regenerate htaccess, because I assume I will loose old redirects. I want to change all 302 to 301. The question is, where are these redirects saved? Some specific file or database? I don't mean main htaccess file when I can add manually 301 redirects. I want to change the existing ones from the file they are already saved in. Thank you, Tom. Link to comment Share on other sites More sharing options...
Johann Posted July 20, 2017 Share Posted July 20, 2017 This is stored in the ps_product table, in the "redirect_type" field this sql request should make what you want : update ps_product set redirect_type=301 where redirect_type=302; Link to comment Share on other sites More sharing options...
Deminer84 Posted July 20, 2017 Author Share Posted July 20, 2017 @Johann thank you so much. I'm changing it for every product. I would like to ask one more question: is it possible to do same thing to all categories, where their old URLs (before url change to different) still work somehow? Link to comment Share on other sites More sharing options...
Deminer84 Posted July 20, 2017 Author Share Posted July 20, 2017 (edited) As I can see, available value (in this case) is "301-category". Next, column "id_type_redirected" changes value probably to category ID where it should redirect. The problem is, when I change it in database, nothing happens in store. In product SEO tab it's still listed 404 (as before). When I disable product visibility in store, it still shows 404 on product page. unfortunately @johann solution isn't working :/ I've found the solution. The problem was the incorrect table. Proper one is ps_product_shop. To apply @johann answer: Set 301 redirect to category: update ps_product_shop set redirect_type="301-category" where redirect_type=404 Then set a redirect to specified category: update ps_product_shop set id_type_redirected=2 where id_type_redirected=0 Edited July 20, 2017 by Deminer84 (see edit history) Link to comment Share on other sites More sharing options...
markriver Posted July 28, 2017 Share Posted July 28, 2017 Nice topic! I like it very much. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now