I have detected an issue with my website https://rometechcases.com/. There are redirects on some product pages to pages with the same products, but with another one URL with "?variant= and a set of numbers" added. No variations are added to such products.
When trying to go to this page, it is redirected to the next page: https://rometechcases.com/collections/pixel-4a/products/google-pixel-4a-case-with-belt-clip-slim-hea...
Such problem appears with many products. Why does it happen? How do I fix this problem?
What you are experiencing with some of your links is referred to as variant deep links. This is intended behavior which allows you to link directly to a variant. There is great reply by another Shopify staff member outlining deep linking, and how you can potentially change them in this Community forum post. I recommend reading through that post. It mentions that you can find more information about deep linking, and how it works here in our Partners Blog.
Do the products with with these variant URLs have more than one variant added? If you are only selling one variant of these products, and would prefer to be able to use the shorter URL for the product, I recommend deleting variants that you will not be selling. This way, the product will not have any variants, and will be linked to the shorter URL you see on your other product pages.
If the primary reason you are concerned about these URLs is for SEO (search engine optimization), I'll pass on a blog article we have on how search engines, such as Google, save and list web pages. It walks through various tactics you can follow in the form of a checklist to rank better on search engines. The link is here if you'd like to learn more!
So checking the json data for that product - there is only one variant, the "Default Title" variant, variant id: 31768367759402 (that's where the ID is coming from anyway).
All singular (no-variant) products technically have this invisible variant called Default Title, just how sShopify works.
Looking at how the page is loading, there is only one HTTP200 pageload, technically there is no "redirect" because there is no 2nd page load, nor is there a JS window.location change or meta redirect occuring. So my hunch was to look for a history state change, something like this:
history.replaceState(stateObj, '', 'bar2.html');
If you load the page, then devtools, sources, CTRL+SHIFT+F and search for 'replaceState', there are a few JS files, a prime candidate was the option_selection.js file - so I blocked the JS file URL in devtools reloaded the root page, and the URL change stopped (but it looks like the image loading broke).
I would start by looking at changing the behavior of that file in your theme, likely there is an option_selector.js file somewhere.