Hide directories in url

Asked

Viewed 129 times

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 ?

  • There are several ways to be done, you use some framework such as Laravel or Zend?

  • No, php usage "pure".

  • You are trying to use the MVC standard?

  • 1

    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.

  • Yes, MVC standard usage.

  • 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

  • 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?

  • Oops, that would actually be it: localhost/home.php

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.