0
I wonder if there is any way in PHP to hide the path of directories in url browser.
For example, this is how it looks: localhost/test/view/home.php
Is there any possibility to show only the .php url, without showing all path ?
0
I wonder if there is any way in PHP to hide the path of directories in url browser.
For example, this is how it looks: localhost/test/view/home.php
Is there any possibility to show only the .php url, without showing all path ?
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
There are several ways to be done, you use some framework such as Laravel or Zend?
– Kenny Rafael
No, php usage "pure".
– KevinF
You are trying to use the MVC standard?
– Clayderson Ferreira
You can create N rules in your file. htaccess, in the example you cite something specific, but I believe you want something dynamic...with some research you find various information, or option would use the micro-framework Slim.
– Kenny Rafael
Yes, MVC standard usage.
– KevinF
So you’re doing it wrong. The home.php file can be accessed by this URL that you informed, however, the correct is that it is accessed through your controller. I suggest you take a look at this video: https://www.youtube.com/watch?v=q8ekGIkU2jE
– Clayderson Ferreira
Hello Kevin. Why do you only want to show . php? I don’t see the point in that. Usually people want to hide .php. It would be something like http://localhost/. php?
– Everton da Rosa
Oops, that would actually be it: localhost/home.php
– KevinF