You can just use the rewrite where request path is
sample-product and the target path is
../. Anyone visiting the URL www.domain.com/sample-product will end up at www.domain.com. The default homepage will also need to be set to your product.
- Navigate to Marketing -> SEO & Search -> URL Rewrites
Find the Magento path of the Product URL by looking within the Rewrite table. I typed in URL of product you want to be your homepage in target path and found request path for that particular product.
Make a note of this URL.
- Navigate to Stores -> Configuration -> General -> Web -> Default Pages
Set the Default Web URL to your product e.g.
Accessing www.domain.com will now show your product.
- Navigate to Marketing -> SEO & Search -> URL Rewrites -> Add URL Rewrite
a. Set Request Path:
b. Set Target Path:
c. Set Redirect Type: Permanent
This sets your product URL so that it will be redirected to the homepage also.