3
I am building an MVC application and was having some problems with the file path css,js and images no html... I was given a solution to use the tag <base>
to define the path that all html files would follow, e.g.: <base href="http://localhost/mvc/>
, only that from then on I had some problems to install javascript plugins, since when I put, for example, href="#"
that by clicking instead of doing no action, this link led me to the url that was set with the tag <base>
that would be http://localhost/mvc/#
, I would like to know how to redirect all "requests" of these files to a subfolder, e.g.:
<link rel="stylesheet" href="main.css">
<img src="images/img2.jpg" />
All requests would lead to a subfolder, for example, PUBLIC, then only need to define in html the folders inside that public...
HTACCESS file:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
I haven’t tried it yet, but I would also like to preserve the htaccess structure that I posted before, will that do it? Thank you!
– Thiago