title: How to get https://www.example.com to redirect to https://example.com without a htaccess file
body: <p>I'm using google cloud platform to host my site and namecheap for the domain name. I want any traffic that hits <a href="https://www.example.com" rel="nofollow">https://www.example.com</a> to redirect to <a href="https://example.com" rel="nofollow">https://example.com</a>. </p>
  
  <p>I currently have <a href="http://www.example.com" rel="nofollow">http://www.example.com</a> and <a href="http://example.com" rel="nofollow">http://example.com</a> redirecting to <a href="https://example.com" rel="nofollow">https://example.com</a> from using DNS URL redirects and having <code>secure: always</code> as a handler in my app.yaml file (for ruby on rails).</p>
  
  <p>I dont know how to have <a href="https://www.example.com" rel="nofollow">https://www.example.com</a> redirect to <a href="https://example.com" rel="nofollow">https://example.com</a>. I've tried adding a <code>.htaccess</code> file but couldn't get it to work so maybe there is a configuration I can have in the app.yaml file or some other way for this to work.</p>