PHP网址怎么隐藏后缀
来源:动视网
责编:小采
时间:2020-11-03 12:30:41
PHP网址怎么隐藏后缀
PHP网址怎么隐藏后缀:PHP网址怎么隐藏后缀首先htdocs根目录下创建文件htaccess并写入规则将URL重写;RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php
导读PHP网址怎么隐藏后缀:PHP网址怎么隐藏后缀首先htdocs根目录下创建文件htaccess并写入规则将URL重写;RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php

PHP网址怎么隐藏后缀
首先htdocs根目录下创建文件htaccess并写入规则将URL重写;
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [L]
然后打开Apache配置文件,将rewrite模块开启,并将AllowOverride后边None改为ALL;


最后重启Apache服务即可;
推荐教程:《PHP教程》
PHP网址怎么隐藏后缀
PHP网址怎么隐藏后缀:PHP网址怎么隐藏后缀首先htdocs根目录下创建文件htaccess并写入规则将URL重写;RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php