使pretty网址,例如mysite的/第1页,而不是mysite的?页面最简单的方法=第1页 [英] easiest way to make pretty urls e.g mysite/page1 rather than mysite?page=page1

查看:124
本文介绍了使pretty网址,例如mysite的/第1页,而不是mysite的?页面最简单的方法=第1页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是美化我的网址最快的方法?

What is the fastest way to beautify my urls?

我一直有一个ID(页面)。我想要的网址被www.mysite.com/page~~V

I always have a single id ('page'). I want the url to be www.mysite.com/page

感谢

推荐答案

假设您的网站上运行Apache,你可以使用的 mod_rewrite的

Assuming your website runs on Apache, you can use mod_rewrite.

只需创建一个的.htaccess 像这样的东西你的Web服务器上的文件:

Simply create a .htaccess file on your web server with something like this:

RewriteEngine On
RewriteBase   /
RewriteRule   (.*)  index.php?page=$1

这篇关于使pretty网址,例如mysite的/第1页,而不是mysite的?页面最简单的方法=第1页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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