How to hide suffix in PHP URL

Guanhui
Release: 2023-03-01 08:48:01
Original
3581 people have browsed it

How to hide suffix in PHP URL

PHP网址怎么隐藏后缀

首先htdocs根目录下创建文件htaccess并写入规则将URL重写;

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
Copy after login

然后打开Apache配置文件,将rewrite模块开启,并将AllowOverride后边None改为ALL;

How to hide suffix in PHP URL

How to hide suffix in PHP URL

最后重启Apache服务即可;

推荐教程:《PHP教程

The above is the detailed content of How to hide suffix in PHP URL. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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