Home  >  Article  >  Backend Development  >  How to remove the path part in php

How to remove the path part in php

藏色散人
藏色散人Original
2021-09-03 09:31:421568browse

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.

How to remove the path part in php

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn