I have a small MVC made by me. With urls Of this type index.php?route=admin/produto/adicionar
, but I wanted to remove index.php?route=
, I already got a line of .htaccess
that was thus www.exemplo.com/admin/produto/adicionar
, the problem is that later the css and js files are not found ( www.exemplo.com/public/public/js/404.php
) :
.htaccess:
RewriteEngine On
RewriteBase /wtj/public
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?route=$1 [L]
File structure:
configs/paths.php(hereiswhereIdefinethepaths):
//foldername=>pathreturn["configs" => "../app/configs",
"controllers" => "../app/controllers",
"css" => "../public/css",
"images" => "../public/images",
"js" => "../public/js",
"includes" => "../public/views/includes",
"lang" => "../app/lang",
"views" => "../public/views"
];
Real message on console, files fetched:
GET link
GET link
What is the redirect scheduled for my 404 page.
The right (route) page is assumed and goes to the right controller / method, but the external files are giving problems.