Skip to content
View in the app

A better way to browse. Learn more.

thirty bees forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Assistance with permanent 301 redirect from old shop platform to new shop platform

Featured Replies

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

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. :)

  • 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.

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.

  • 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?

  • 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

  • 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]

@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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.