0
I have a framework, where I want to divide it into several frameworks (MVC) per folder at the root of the domain. At the root of the domain I have no file, there are folders where I have file at the root of each folder one .htaccess
thus:
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1
I would like my www.meudominio.com.br to have several folders, for example:
www.meudominio.com.br/pasta1
www.meudominio.com.br/pasta2
www.meudominio.com.br/pasta3
And in each folder (e.g., pasture 1, pasture 2, pasture3) had a file .htaccess
to load a framework separately with other file structures with the file in boot set index.php
and other folder structure (framework)
- app
-- controllers
-- models
-- views- system
-- helpers- web
.htaccess
index php.
Okay, but what’s the problem? Create folders with the
.htaccess
inside didn’t work?– Woss
I created it separately, but, it gives error of redirecting the places, for example, add the path of pasture1 for example. I enter www.meudominio.com.br/pasta1/admin/login (where admin is the controller and login the action) after that all that is done is disappeared from the absolute path the root path "pasta1".
– Thyago ThySofT
How so disappeared? Have you [Edit] the question and add the contents of these files
.htaccess
? There is a.htaccess
at the root of the project?– Woss
I use a www.dominio.com.br/controller/action, where www.dominio.com.br is the absolute base path always, like making the absolute base path a folder level for example, I thought it could be set somewhere just once, otherwise until image paths have to set such folder.
– Thyago ThySofT
But if you want multiple frameworks, the base path should not be
dominio.com/pasta1
? If not, how your application will know which framework it should load?– Woss
True, but that’s what I don’t know how to do and need this help. Where to set the base path of the friendly URL’s?
– Thyago ThySofT
It’s a little hard to understand. If you access
dominio.com/pasta1/controller/action
, will execute the.htaccess
of the directorypasta1
and load the pagepasta1/index.php?url=controler/action
, right? Theaction
accessed is displayed? What exactly happens when accessed this URL?– Woss
Let’s go continue this discussion in chat.
– Thyago ThySofT