Exactly what you want, mod_rewrite solves the question as Patrick replied, but by elaborating a bit more, .htaccess might not be considered the "smart" option, and not all php web servers work from Similarly, you can for example use other alternatives such as a symbolic link , both Windows and Linux support it, even if you do not have direct access to the server, ie if shared, you can do with a PHP script, or a full PHP option, as I do in my framework that you can adapt to yours.
link
In my HMVC framework, what I do is have in the view the path of the 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>
While not exactly your need, to remove the 'examples / helloworld / views /' you can do as previously said create a symbolic link, or else the css or js directory could be, without any problem defined in the same path than the index.php.
So each MVC triad is allowed to encapsulate its specific resources.
link