title: php mvc and .htaccess url rewrite
body: <p>I am a new programmer, currently learning php mvc. I am building a framework/mvc system from scratch...Now I am facing problem with .htaccess. </p>
  
  <pre><code>    example.com = localhost // unable to post question for localhost link
  </code></pre>
  
  <p>My application url is like this...</p>
  
  <pre>        http://example.com/mvc/index.php?go=test //test is a controller's name</pre>
  
  <p>By the help from .htaccess I cleaned the url to....</p>
  
  <pre>        http://example.com/mvc/test</pre>
  
  <p>If a controller does not exists it shows an error view, which contains some error message.
      <pre>        <code>http://example.com/mvc/doesnotexists</code></pre> But if I put "/" (forward slash) in the url... <pre>        <code>http://example.com/mvc/test/</code></pre> it shows the error but does not load any css or js file.</p>
  
  <p>I have also included controllers method in url...<pre>        <code>http://example.com/mvc/test/viewresult</code></pre> If no matched method found in that controller show error message, it shows but same problem...no css nor js.</p>
  
  <p>I have fully loaded css and js if I go through full url  <pre>        <code>http://example.com/mvc/index.php?go=doesnotexists/</code></pre>  and so on</p>
  
  <p>I have tried several .htaccess rules but unable to get it work. Please help and thanks in advance.. My currrent .htaccess code...</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;  
  
      # Turn on 
      RewriteEngine On
  
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-l
  
      #RewriteCond %{REQUEST_URI} !^/assets/
      #RewriteCond $1 !^(favicon\.ico|favicon\.png|media|robots\.txt|crossdomain\.xml|.*\.css|.*\js)
  
      RewriteRule ^(.+)$ index.php?go=$1 [QSA,L]
  
     # Generic 404 for anyplace on the site  
     # ...  
  
  &lt;/IfModule&gt;  
  </code></pre>