用户友好的 URL 而不是查询字符串? [英] User-friendly URLs instead of Query Strings?
问题描述
可能的重复:
在 php 中使用 seo 用户友好
代码点火器中的自定义路由
我正在开发一个 CMS,我想使用用户友好的 URL 而不是查询字符串.
I'm deving a CMS and I wanna use User-friendly URLs instead of Query Strings.
例如:
mysite.com/cat_1 =>mysite.com/cat_1/itme_1
代替
mysite.com/?cat=1 =>mysite.com/?item=1
我应该如何实现这一点?任何标准方式?
How should I implement this? any standard way?
我的想法是使用半动态页面并使用使用查询字符串的动态页面的用户友好 URL 生成静态快照.
My idea is to use of semi-dynamic pages and generating static snapshots with user-friendly URLS of dynamic pages that use query strings.
推荐答案
这是通过使用 .htaccess 修改 URL 发送到客户端的方式来实现的.或者正如其他人所说,美化 URL.以下是一些文章链接,可帮助您开始使用实现此功能所需的 mod_rewrite
规则.
This is accomplished through the use of .htaccess to modify how the URL is sent to the client. Or as other people say, to prettify the URL. Here are some links to articles to help you get started with the mod_rewrite
rules required to make this function.
http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/
http://www.roscripts.com/Pretty_URLs_-_a_guide_to_URL_rewriting-168.html
这篇关于用户友好的 URL 而不是查询字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!