title: How do I access scripts outside of my root directory?
body: <p>I have another question up about this but I thought it might be best to create a new question to get more detailed with this second issue.</p>
  
  <p>I am on an Shared Hosting account and its an Apache server. </p>
  
  <p>I have some backend scripts that I want to protect from being accessed directly via the url. For example I do not want someone to be able to go to mysite.com/php/cms/addEditors.php as I fear there could be some security issues. So to do this I have created a new root directory. My structure looks something like this</p>
  
  <pre><code>Public
  | index.php
  | Login.php
  | EditorHome.php
  Src
  | CMS
  | | loginProcess.php
  | | logoutProcess.php
  | | addEditors.php
  </code></pre>
  
  <p>To do this I have an .htaccess page  in the same directory as the Public and Src directories that has these 2 lines that make the Public directory my root</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^$ /Public [L]
  </code></pre>
  
  <p>The problem that I am having is when I put in the login details and submit I get an 404 Error that says:</p>
  
  <p><strong><em>The requested URL /Src/CMS/loginProcess.php was not found on this server.</em></strong></p>
  
  <p>even though the code that directs it to the loginProcess looks like this</p>
  
  <p><strong>../Src/CMS/loginProcess.php</strong></p>
  
  <p>Also, is there a way to remove /Public/ from being in the URL with .htaccess? I would prefer it be </p>
  
  <p><strong><em>mysite.com/login.php</em></strong></p>
  
  <p>rather than</p>
  
  <p><strong><em>mysite.com/Public/login.php</em></strong></p>