title: Rewrite rules for localhost AND live environment
body: <p>I want to add rewriterules that works in local environment (localhost) and on my liveserver.</p>
  
  <p>Why?</p>
  
  <p>I don't want to change rules when I test my project locally and upload it to the liveserver.</p>
  
  <ol>
  <li><p><strong>Adding Rules</strong></p>
  
  <p>Here an example</p>
  
  <pre><code>(ANY-URL)index.php?page=somepage
  </code></pre>
  
  <p>change to</p>
  
  <pre><code>(ANY-URL)/somepage
  </code></pre>
  
  <p>So I used a rewritemod generator and pasted this into it:</p>
  
  <pre><code>index.php?page=somepage
  </code></pre>
  
  <p>The rewriterule I got, looks like this: (of course my .htacces starts with RewriteEngine On)</p>
  
  <pre><code>RewriteRule ^([^/]*)$ /?page=$1 [L]
  </code></pre>
  
  <p>When I try to get to <code>(http:) 
  //localhost/myproject/development/index.php?page=login</code> it sends me to the root directory of my local development envirment. But the URL in the adressline doesn't change.</p></li>
  <li><p><strong>Testing</strong></p>
  
  <p>Of course I tried some other Rules by pasting the whole URL into the generator just to test if the rewrite thing works. 
  Also here the URL doesn't change to short-url but the server cant find stylesheets and javascripts anymore. I got redirected to the index.php</p></li>
  <li><p><strong>Possible solutions?</strong></p>
  
  <ul>
  <li>Maybe it has something todo with that "RewriteBase"?</li>
  <li>Do i have to set a basepath?</li>
  </ul></li>
  </ol>
  
  <p>My .htacces is located here:</p>
  
  <pre><code>//localhost/myproject/development/.htaccess
  </code></pre>
  
  <p>Later I also want to change paths that look like this:</p>
  
  <pre><code>(ANY-URL)index.php?page=somepage&amp;second=hello&amp;third=world&amp;fourth=cool
  </code></pre>
  
  <p>Also here a I'm looking for a solution that works on both environments.</p>