i’m trying to implement a self made MVC + front controller project, after 2 days of hard work, all seems to be ok. But today i discover an curious bug on my app.
When i request an url with 2 (or more) slashes (for example http://www.site.com/home/show) my css, js files wont work.
I’m not an apache expert then i think i fail something there…
my virtualhost file (O.S. Ubuntu):
<VirtualHost *:80>
ServerAdmin baro.luc@gmail.com
ServerName servername
DocumentRoot /path_to_project/project_folder
<Directory /path_to_project/project_folder>
Options FollowSymLinks
</Directory>
</VirtualHost>
my .htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
I followed that example for my project: https://github.com/Jontyy/PHP-Basic-MVC-Framework
I solved my issue by passing an absolute path to my css/js files like that: