创建一个页面而不将 .php 放在最后? [英] Create a page without placing .php at the end?

查看:35
本文介绍了创建一个页面而不将 .php 放在最后?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找模仿我见过的东西的方法,但我真的不知道从哪里开始或如何搜索它.

I was looking for ways to mimic something I've seen, however I'm really not even sure where to start or how to search for it.

假设我的页面是:

foo.com/和我的索引页面可以采用以下参数:index.php?id=5

foo.com/ and my index page could take an argument of: index.php?id=5

我想做的是创建以下内容:

What I'm wanting to do is create the following:

foo.com/5/而不是放置 index.php?id=5 只是使用 webstring 传递参数,不仅隐藏它是 PHP 页面的事实,而且更清理 url.

foo.com/5/ rather than placing index.php?id=5 just use the webstring to pass in the parameters, to hide not only the fact its a PHP page, but to clean up the url a bit more.

这可能吗?

干杯

推荐答案

您需要研究 URL 重写.使用常用的 Apache 网络服务器,这是通过 mod_rewrite 完成的.

You'll want to look into URL rewriting. With the commonly used Apache webserver, this is accomplished with mod_rewrite.

这篇关于创建一个页面而不将 .php 放在最后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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