title: htaccess regex return Internal Server Error
body: <p>I'm new to apache &amp; php world and I struggle with .htaccess redirections.
  Here is what I want to do:
  people of trust will have access to a dedicated directory in <em>/members</em>. </p>
  
  <pre><code>/ =&gt; index.php
  /&lt;user&gt; =&gt; /members/&lt;user&gt;/index.{php,html}
  /&lt;user&gt;/... =&gt; /members/&lt;user&gt;/...
  /&lt;user&gt;/reload = &gt; index.php?reload=&lt;user&gt;
  </code></pre>
  
  <p>Directory layout:</p>
  
  <pre><code>- index.php
  - .htaccess
  - members/
    - &lt;user1&gt;/
      - member's html/php
    - &lt;user2&gt;/
  </code></pre>
  
  <p>What I've done so far (not working): </p>
  
  <pre><code>RewriteEngine On
  
  RewriteCond %{HTTP_HOST} ^www.subdomain.exemple\.com [NC]
  RewriteCond %{SERVER_PORT} 80
  RewriteRule ^(.*)$ https://www.subdomain.exemple.com/$1 [R,L]
  
  RewriteCond %{HTTP_HOST} ^subdomain.exemple\.com [NC]
  RewriteCond %{SERVER_PORT} 80
  RewriteRule ^(.*)$ https://www.subdomain.exemple.com/$1 [R,L]
  
  
  RewriteRule ^/$ index.php [L]
  RewriteRule ^$ index.php [L]
  
  # [a-z]+ is member's username
  RewriteRule ^([a-z]+)/reload/$ index.php?reload=$1 [L]
  RewriteRule ^([a-z]+)/reload$ index.php?reload=$1 [L]
  
  
  #ROOT (I don't know how to redirect to php or html depending on which file exists)
  RewriteRule ^([a-z]+)/$ members/$1/index.php [L]
  RewriteRule ^([a-z]+)$ members/$1/index.php [L]
  
  #Every other URL excluding / and /&lt;user&gt;/reload
  RewriteRule ^(.+)$ members/$1 [L]
  
  </code></pre>
  
  <p>I also want to "isolate" members' directory by prohibiting php scripts to access parent directories. I've found this but does it mean I should write a rule for each member's directory?</p>
  
  <pre><code>&lt;Directory /parentDirectory/childDirectoryOne&gt;
   php_admin_value open_basedir "/parentDirectory/childDirectoryOne"
  &lt;/Directory&gt;
  </code></pre>