title: Set apache redirect from http to https for a specific url
body: <p>I would like to redirect any URL path that is having a /test to <a href="https://localhost/test" rel="nofollow">https://localhost/test</a>. Also, if an url is /test?user=123 it has to be redirected to <a href="https://localhost/test?user=123" rel="nofollow">https://localhost/test?user=123</a> or rather if the url is /test/test_db/user?id=123&amp;pwd=123 has to be redirected to <a href="https://localhost/test/user/test_db/user?id=123&amp;pwd=123" rel="nofollow">https://localhost/test/user/test_db/user?id=123&amp;pwd=123</a></p>
  
  <p>All other requests of any kind has to be redirected to a html page that says "Access denied" in the root folder(http://localhost/accessdenied.html).</p>
  
  <p>How do I achieve this with RedirectMatch in apache. I tried something like</p>
  
  <pre><code>RedirectMatch permanent ^test/(.*)$ https://localhost/test/$1
  </code></pre>
  
  <p>Which did not work. </p>