如何不用在URL中.php扩展名执行PHP网页? [英] How to execute a PHP web page without the .php extension in the URL?

查看:96
本文介绍了如何不用在URL中.php扩展名执行PHP网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,noob问题,不能从我应该寻找什么了解。

Sorry for noob question, can't understand from what I should search.

我在做一个网站与网页 product.php?ID = 777 结果
我想它是产品/ 777

I'm making a site with that page product.php?id=777
I'd like it to be product/777

感谢您!

推荐答案

在您的Web根目录下创建.htaccess文件,并输入以下有:

Create .htaccess file in your web root and enter following there:

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^product/([0-9]+)$ product.php?id=$1

这篇关于如何不用在URL中.php扩展名执行PHP网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆