title: AWS CloudFront redirecting to S3 bucket
body: <p>I have created a CloudFront distribution to serve the static website. S3 is origin server.
  Now if we access CloudFront URL, it redirects to S3 location.</p>
  <p><code>d2s18t7gwlicql.cloudfront.net</code>
  or
  <code>test.telekha.in</code></p>
  <p>In the browser it is showing
  <a href="https://telekha-test-www.s3.ap-south-1.amazonaws.com/index.html#/dashboard" rel="noreferrer">https://telekha-test-www.s3.ap-south-1.amazonaws.com/index.html#/dashboard</a></p>
  <p>I am expecting <a href="https://test.telekha.in/#/dashboard" rel="noreferrer">https://test.telekha.in/#/dashboard</a></p>
  <p>If I access <a href="https://test.telekha.in" rel="noreferrer">https://test.telekha.in</a> through curl it returns my <code>index.html</code> document</p>
  <p>If I access <a href="http://test.telekha.in" rel="noreferrer">http://test.telekha.in</a> through curl it returns</p>
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;301 Moved Permanently&lt;/title&gt;&lt;/head&gt;
  &lt;body bgcolor=&quot;white&quot;&gt;
  &lt;center&gt;&lt;h1&gt;301 Moved Permanently&lt;/h1&gt;&lt;/center&gt;
  &lt;hr&gt;&lt;center&gt;CloudFront&lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>But in browser both HTTP and HTTPS are redirecting to <a href="https://telekha-test-www.s3.ap-south-1.amazonaws.com/index.html#/" rel="noreferrer">https://telekha-test-www.s3.ap-south-1.amazonaws.com/index.html#/</a></p>
  <p>Please let me know how to resolve this issue.</p>