.htaccess从动态到静态(从数据库中的id到名称)
我有一个问题。如何将动态地址更改为静态地址,如下所示: 从: www.something.net/default.asp?lang=en&page=10&id=22 到: www.something.net/jacket
在我的数据库(MS access)中,我有一个名为 Items(列 id 和名称)的表。在 id=22 处,我有一个名为 Jacket 的项目,
我只想通过重新编程 .htaccess 文件来做到这一点。有什么想法或好的例子吗?阅读了之前的帖子,但还没有完全弄清楚。
感谢您的帮助。
I have one problem. How can I change the dynamic address to a static one, like shown below:
from:
www.something.net/default.asp?lang=en&page=10&id=22
to:
www.something.net/jacket
In my database(MS access) I have a table called Items(colums id and name). At id=22, I have an item named jacket
I want to do this only by re-programing the .htaccess file..Any idea or good example? Read previous posts about it, but didn't quite figure it out yet.
Thanks for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,您需要使用重写映射 - 您的问题与 非常相似mod_rewrite,.htaccess 连接mysql数据库。
您还可以有一张公式或宏,将您的电子表格转换为一组重写规则,然后将其粘贴/保存到 htaccess 文件中。
For this, you would need to use a rewrite map - your question is very similar to mod_rewrite, .htaccess connecting to mysql database.
You could also have a sheet of formulas, or macro that converts your spreadsheet into a set of rewrite rules, and then paste/save this into a htaccess file.