I use the following parameter to rewrite the URL:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
In index.php , $_GET['url'] is parsed, so in the following examples:
ROOT/user/id/1/name/bobby // user is the page, id = 1, name = bobby ROOT/blog/post/123/title/welcome // blog is the page, post = 123, title = welcome
So the first parameter (? I donβt know what to call it) is the name of the page, then the following pair of parameters is similar to "keys / value". Now, when I look through the ROOT/ link to the stylesheets inserted inside the html page, and the page displays correctly. I look at ROOT/index (this is the same as ROOT/ ), it shows the page (with content and other material) correctly, but links (even if correctly written in the html structure) are not loaded into the style sheets. And I see this because my page does not have CSS at all when I load it.
How can i fix this?
EDIT
The css file path is as follows:
project/view/css/common.css
The file it is in is located in
project/public/index.php
This leads me to create a link (inside index.php) like
../view/css/common.css
But it works depending on how the URL looks. Examples:
# For URL = public/ project/view/css/common.css
source share