3
I am building a php application with MVC, the problem is when accessing other directories by URL, Ex: mvc/user (so far all right) now: mvc/user/create (here the css style sheet and javascript are no longer found) what is the best way to fix this? define a constant or configure htaccess?
Structure
-controllers/
-lib/
-public/
--css/
--js/
--images/
-models/
-views/
--Index/
--Create/ ...
Header.phtml
Footer.phtml
.htaccess
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1
All very simple.
Using some framework? Could you show how the directory structure is?
– Cahe
No, I’m doing the hand to study. here the structure: -controllers/ -lib/ -public/ --css/ --js/ --images/ -models/ -views/ --Index/ --Create/ ...
– Thiago
How is the . htaccess script that does the redirects? Edit your question with the answers you put here in the comments.
– Cahe