November 4, 20179 yr Hi, We'd like to migrate from our old shop platform to tb. All the links should remain valid and receive a permanent redirect. Old shop URL template www.shop.com/productinfo.php?productsid=82 New shop URL template www.shop.com/index.php?idproduct=50&controller=product&idlang=2 (apparently, idlang is necessary, see https://forum.thirtybees.com/topic/1036/url-with-idproduct-does-not-work-needs-id_lang) I've mapped the respective product IDs and would need to generate the permanent 301 redirect now. If we take the above template examples and want to map the old URL to the new URL, would this be the correct way to do so? RewriteCond %{QUERY_STRING} products_id=82 RewriteRule ^(.*)$ http://www.shop.com/index.php?id_product=50&controller=product&id_lang=2 [L,R=301] How do I put the code in the .htaccess file with thirty bes? Under Preferences>SEO & URLs it says the .htaccess is automatically generated. I don't want the code to be overwritten by tb. Is there anything else I need to consider besides placing that code in the .htaccess file? Thanks
November 4, 20179 yr Place any .code under the.. ``` ~~end~~ Do not remove this comment, thirty bees will keep automatically the code outside this comment when .htaccess will be generated again ``` ...and it will not be overwritten. As to the correct way of doing it...it's above my paygrade. :)
November 4, 20179 yr Author Thanks, @SLiCK_303! I also discovered this module: https://addons.prestashop.com/en/url-redirects/11399-301-302-303-url-redirects-and-404-seo.html But let's see whether someone here in the forum knows.
November 4, 20179 yr Try like that: Redirect 301 /product_info.php?products_id=82 /index.php?id_product=50&controller=product&id_lang=2 As @SLiCK_303 pointed out. This line must be outstide the comment.
November 11, 20179 yr Author @wakabayashi I tried it now that the new site is live with the .htaccess, but a page like https://httpstatus.io/ gives me a 404. :( Any ideas?
November 11, 20179 yr Author I also tried, unsuccessfully: Redirect 301 /product_info.php?products_id=82 https://www.shop.com/index.php?id_product=50&controller=product&id_lang=2
November 14, 20179 yr Author Solved: RewriteEngine On RewriteCond %{REQUESTURI} ^/productinfo.php$ RewriteCond %{QUERYSTRING} ^productsid=5 RewriteRule ^(.*)$ https://www.shop.com/index.php?id_product=17&controller=product [R=301,L]
November 17, 20179 yr @30knees Thanks for initiating and solving this issue. It will be helpful for others needing 301 redirects. Kudos!
Create an account or sign in to comment