title: show product slug only without id in url
body: <p>I have a list of classifieds and when a user clicks on one it takes them to the detail page. I just want the slug in the url ie: </p>
  
  <p><a href="https://someshop.com/red-bag" rel="nofollow noreferrer">https://someshop.com/red-bag</a></p>
  
  <p>I am able to do this but the problem is that the product names are not unique as more than one user may want to add a 'red bag' at some point. So, what I have done is used the ID and the slug eg:</p>
  
  <p><a href="https://someshop.com/4d35c2fcef9b6c17167ff53y/red-bag" rel="nofollow noreferrer">https://someshop.com/4d35c2fcef9b6c17167ff53y/red-bag</a></p>
  
  <p>But that doesn't look particularly nice. Is there a way to still check against the ID but not actually show it in the url?</p>
  
  <p>html href:</p>
  
  <pre><code>&lt;a href="/products/&lt;%= product._id %&gt;/&lt;%= product.titleSlug %&gt;" class="listing-item-container"&gt;
  </code></pre>
  
  <p>router:</p>
  
  <pre><code>router.get('/products/:productId/:titleSlug', shopController.getProductDetail);
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>exports.getProductDetail = (req, res, next) =&gt; {
      const titleSlug = req.params.titleSlug;
      const productId = req.params.productId;
      Product.findOne({titleSlug: titleSlug, _id: productId})
      .then(product =&gt; {
          res.render('shop/product-detail', {
              pageTitle: 'Product detail',
              path: '/products',
              product: product
          });
      })
      .catch(err =&gt; {
          console.log(err);
      });
  };
  </code></pre>