Reputation: 3259
Rapid question, I'm using this line:
RewriteRule ^([^/]+)/? index.php?url=$1 [L,QSA]
which I took from another post and now my CSS file won't show anything.
This is the structure:
.
+-- .htaccess
+-- assets
| +-- style.css
| +-- images
+-- index.php
And there are other files but they're irrelevant.
Upvotes: 0
Views: 30
Reputation: 786091
You are missing 2 things:
$
anchor in your regex patternReplace your code with this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .+ index.php?url=$0 [L,QSA]
Also if you are using relative paths for your css/js/images then you can add this just below <head>
section of your page's HTML:
<base href="/" />
so that every relative URL is resolved from that base URL and not from the current page's URL.
Upvotes: 2