A product link should do more than open a page: it should take a shopper to the right product, preserve their selected options, work when shared in a message, and remain useful to search engines. Poorly designed links can lose variant choices, create duplicate URLs, or send shoppers to missing pages.
This tutorial explains product URL best practices for Indian ecommerce developers and store owners. You’ll learn how to represent product variants, use query parameters and tracking tags, set canonical URLs, and handle broken product links.
Key takeaways
- Give every product a stable, readable URL, and make sure it opens without requiring a previous browsing session.
- Preserve shareable selections such as size or colour in the URL when shoppers should land on that exact variant.
- Keep campaign tracking parameters separate from the product’s canonical URL.
- Redirect retired product URLs to a relevant replacement when one exists; otherwise, return an honest not-found or gone response.
- Test complete links on mobile and after copying them into common sharing channels.
Design a stable product URL
A useful product URL is descriptive, consistent, and independent of temporary details such as price, inventory, or campaign source. For example:
https://shop.example.in/products/cotton-kurta
Use a product slug that is understandable to people and stable over time. Avoid putting details that change frequently—such as a sale price, stock count, or promotion name—into the permanent path. If a product name must change, keep a redirect from the previous URL to the new one.
For Indian stores, decide how your URL strategy handles languages, scripts, and regional storefronts. A translated product page may have a distinct URL, but language or region should be represented consistently across the site. Do not create arbitrary URL variations for the same page without a clear purpose.
You can inspect URL components to see how a link is divided into its scheme, host, path, and query string. This is useful when checking whether a product or campaign link contains unexpected parameters.
Represent product variants clearly
A product variant is a purchasable option such as size, colour, pack quantity, or storage capacity. Decide whether a selected variant needs its own shareable URL.
Use a query parameter for a selected variant
A query parameter can identify a variant while keeping the product page path unchanged:
https://shop.example.in/products/cotton-kurta?variant=blue-medium
The value should map to a stable variant identifier in your catalogue. When this URL opens, the page should select the blue, medium option and show its current availability and price. Do not rely only on browser state or a cookie: a recipient opening a shared link should see the intended selection directly.
Use a distinct path when variants are separate pages
Some catalogues treat options as independently indexable pages or products. In that case, a path can make the distinction explicit:
https://shop.example.in/products/cotton-kurta/blue-medium
Choose one primary URL design and apply it consistently. The choice depends on your catalogue, routing system, and search strategy. A separate URL does not automatically mean every variant should be indexed as a separate search result.
Keep variant state valid
A shared variant link can become stale if the option is discontinued or temporarily unavailable. In that case, keep the product page accessible and explain the availability status. If the requested variant no longer exists, select a sensible default or show a clear message rather than silently displaying a different option as though it were the one requested.
Use query parameters deliberately
Query parameters are the portion of a URL after ?, such as variant=blue-medium. Multiple parameters are separated with &:
https://shop.example.in/products/cotton-kurta?variant=blue-medium¤cy=INR
Only include parameters the page actually uses. Common purposes include selecting a variant, applying a filter, or identifying a campaign. Avoid adding parameters that expose personal information or contain temporary internal state.
When building links in code, use a URL API rather than joining strings by hand. This helps encode parameter values correctly:
const productUrl = new URL("https://shop.example.in/products/cotton-kurta");
productUrl.searchParams.set("variant", "blue-medium");
console.log(productUrl.toString());
The example constructs a link; it does not validate that a variant exists. Check the variant identifier against your catalogue before rendering a selected option. For values containing spaces or non-ASCII characters, rely on URL encoding rather than manually replacing characters.
Avoid conflicting or redundant parameters
Do not let duplicate parameters produce unpredictable results, such as two different variant values in one link. Decide how your application handles unknown parameters, and avoid creating multiple equivalent links solely because parameter order differs. If parameters control meaningful page state, make sure that state can be loaded consistently on both the client and server where applicable.
Create tracking links without changing the product identity
Campaign parameters can help analytics systems attribute visits. A social campaign link might look like this:
https://shop.example.in/products/cotton-kurta?utm_source=instagram&utm_medium=social&utm_campaign=summer_launch
Use consistent, lowercase values and avoid personal data in tracking parameters. A campaign link should still open the same product page for someone who copies it into a message. If a selected variant matters, include that state as well:
https://shop.example.in/products/cotton-kurta?variant=blue-medium&utm_source=whatsapp&utm_medium=referral&utm_campaign=festive_edit
Keep analytics conventions documented so teams do not create several spellings for the same campaign. For example, decide whether the team uses whatsapp or another agreed source value, and apply it consistently. Tracking parameters are not a substitute for analytics consent or privacy practices that apply to your store.
Set canonical URLs thoughtfully
Query strings can create several URLs that display substantially the same product. A canonical link element tells search engines which URL your site considers the preferred version of a page. It is a signal, not a guarantee that a search engine will select that URL.
For a product page where tracking parameters do not change the underlying content, the page can point to its clean product URL:
<link rel="canonical" href="https://shop.example.in/products/cotton-kurta">
If a variant has a distinct page that you intentionally want treated as a separate page, consider whether it should have its own canonical URL. If variants are simply selectable states of one product page, a canonical pointing to the main product URL may be more appropriate. Make the choice consistent with the pages you want indexed and the way your site presents those variants.
Do not canonicalize every URL to the homepage, and do not use a canonical tag to conceal broken routing or contradictory page content. Check that the canonical destination loads successfully, uses the preferred HTTPS host and path, and agrees with your internal links and sitemap.
Handle broken and retired product links
Broken links frustrate shoppers and can waste the value of links shared in emails, social posts, or other sites. Monitor for links that return errors, redirect in loops, or land on an unrelated page.
Use a response that matches the product’s status:
- URL changed: Redirect the old URL to the new URL for the same product. Use a permanent redirect when the change is intended to last.
- Product temporarily unavailable: Keep the page available if practical, show its status, and offer relevant alternatives without pretending the item is in stock.
- Product permanently removed with a close replacement: Redirect to the replacement only when it genuinely satisfies the same shopper intent.
- Product permanently removed without a suitable replacement: Return an appropriate not-found or gone response and provide useful navigation on the error page.
Avoid sending every retired product to the home page. That hides the reason the link failed and can mislead visitors. Also avoid redirect chains: update old routes to point directly to the final destination where possible.
A practical product-link workflow
Before publishing a product link, use this checklist:
- Open the clean URL in a private browser window to confirm it loads without prior session state.
- Test the selected variant by opening its shared URL in a new tab or on another device.
- Check availability behavior for a discontinued, sold-out, or invalid variant.
- Add campaign parameters only when attribution is needed, and confirm the landing page still works.
- Inspect the canonical element on the page and verify that it points to the intended preferred URL.
- Copy and share the link through the channels your customers use, including messaging apps, and check that the link is not truncated or redirected unexpectedly.
- Test changed and retired URLs to confirm redirects and error responses match the product’s status.
Common mistakes to avoid
- Depending on session state: A link that shows the right variant only for the original shopper is not reliably shareable.
- Putting volatile details in the path: Prices and inventory change; keep them out of permanent product URLs.
- Treating all query parameters alike: Variant state may affect what a shopper sees, while campaign tags usually describe how they arrived. Handle each according to its purpose.
- Using inconsistent canonical targets: Canonical tags, internal links, redirects, and sitemaps should not point to conflicting versions without a deliberate reason.
- Redirecting unrelated products: A redirect should be relevant to the original item, not merely convenient.
- Ignoring encoding and duplicate values: Construct URLs with a URL API and validate parameter values against known product data.
Conclusion
Good product URL practices make links easier to share, keep variant choices understandable, and help your store manage tracking and indexing consistently. Use stable product addresses, make important variant state reproducible, keep campaign tags purposeful, and give changed or retired URLs an honest destination. Test links as a recipient would—without your store session and on the devices and channels your customers use.
