This is my file structure: you can see it here or
-resources/
--css/
---index.css
-src/
--views/
---main.view.php
--main.php
index.php
.htaccess
This is my .htaccess:
RewriteEngine On
RewriteRule ^(.*)$ index.php?url=$1 [L,QSA]
This is how I include the CSS in the view
<link rel="stylesheet" href="resources/css/index.css">
Problem: When I Include main.php (that includes the view) in index.php the CSS does not work no matter where I place the index.css. Any hint?
You need to add in a rule to exclude rewriting of assets
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt|css)