Jump to content
thirty bees forum
  • 0

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


Question

Posted

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

7 answers to this question

Recommended Posts

  • 0
Posted

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

  • 0
Posted

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.

  • 0
Posted

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.

  • 0
Posted

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]

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...