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.
example.com = localhost // unable to post question for localhost link
My application url is like this...
http://example.com/mvc/index.php?go=test //test is a controller's name
By the help from .htaccess I cleaned the url to....
http://example.com/mvc/test
If a controller does not exists it shows an error view, which contains some error message.
http://example.com/mvc/doesnotexists But if I put "/" (forward slash) in the url... http://example.com/mvc/test/ it shows the error but does not load any css or js file.
I have also included controllers method in url...
http://example.com/mvc/test/viewresult If no matched method found in that controller show error message, it shows but same problem...no css nor js.
I have fully loaded css and js if I go through full url
http://example.com/mvc/index.php?go=doesnotexists/ and so on
I have tried several .htaccess rules but unable to get it work. Please help and thanks in advance.. My currrent .htaccess code...
<IfModule mod_rewrite.c>
# 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
# ...
</IfModule>
<base href=>workaround, which exists for that very purpose.