I was trying a MVC tutorial by howcode on youtube but found that htaccess does not allow my css and js files to load.
.htaccess file:
RewriteEngine On
RewriteRule ^([^/]+)/? index.php?url=$1 [L,QSA]
I tried to find some solutions over the internet but end up generating other errors. I used conditions before the rule:
RewriteCond %{REQUEST_FILENAME} -f
But this doesn't seem to work.
Project Structure -
I have these files in project
- Classes (folder)
- Controller (folder)
- Views (folder)
- .htaccess
- index.php
- Routes.php
In Views folder I have-
- css (folder)
- js (folder)
- index.php
- header.php
- footer.php
My all the imports are in header.php and header.php is included in index.php
My code for linking css is-
<link href="./Views/css/style.css" rel='stylesheet' type='text/css' media="all" />
RewriteCond