title: How do I get an if statement with window.location.pathname in JS/Jquery to not include anything after the pathname?
body: <p>I am trying to get this URL "http://www.example.com/<b>womens-collection/ceramic</b>" to redirect to a URL, "http://www.example.com/the-ceramic".  Below is the code</p>
  
  <pre><code>   if(window.location.pathname == "/womens-collection/ceramic") {
     //alert("worked");
     document.location = "/the-ceramic";
     //$('#jbw-spot-mobile_details').toggleClass('opened')}
  </code></pre>
  
  <p>Works fine but I do not want any of the other URLs that are products to be affected by this like "http://www.example.com/womens-collection<b>/ceramic?page=shop.product_details</b>"</p>
  
  <p>How can I get jquery to only recognize "/womens-collection/ceramic" and not anything after that?</p>