Exactly what you want, mod_rewrite solves the question as Patrick answered, but elaborating a little more, the . htaccess may not be considered the most "stylish" option, and not all php web Servers work the same, you can for example use other alternatives like, a Symbolic link, both Windows and Linux support it, even if you don’t have direct access to the server, ie, if it’s shared, you can do it with a PHP script, or a full PHP option, as I do in my framework that you can adapt to your.
http://pedrosimoes79.github.io/silverbullet/
In my HMVC framework, what I do is to have a view path view, which allows me to define paths in a generic way like this:
view /examples/helloworld/views/hello.php
<script src="<?= $view_path ?>js/hello.js">
Application/Module: helloworld
View: hello
And the path will be:
<script src="examples/helloworld/views/js/hello.js"></script>
Although it is not exactly your need, to remove the 'examples/helloworld/views/' one can as I said earlier create a Symbolic link, or else the css or js directory could be, no problem at all defined in the same path as index.php.
This allows each MVC to encapsulate its specific features.
http://pedrosimoes79.github.io/silverbullet/
Be more specific about what the problem is, as it is very vague.
– Daniel Omine
I forgot to finish after adding the image, forgive me. rs
– Edgard Hufelande