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

How to remove the path part in php

藏色散人
Release: 2023-03-12 10:34:01
Original
1596 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template