Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
30knees

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

Question

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

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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]

Share this post


Link to post
Share on other sites

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