Home > Article > Backend Development > How to remove the path part in php
How to remove the path part in php: 1. Find the htaccess file; 2. Modify the content to "AllowOverride All"; 3. Place the htaccess file in the corresponding directory and set the content to Options-Indexes.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
How to remove the path part of php?
Problem description:
For example, I have localhost/thesis/img/, and I want users to only see the path in img. If access localhost/thesis and other paths will be prohibited. What should I do? Do I have to use ftp to do this?
Solution:
Use .htaccess file.
apache opens htaccess fileAllowOverride All
Then put a .htaccess file in the thesis directory with the content Options -Indexes
Recommended learning: "PHP Video Tutorial 》
The above is the detailed content of How to remove the path part in php. For more information, please follow other related articles on the PHP Chinese website!