Apache:mod_rewrite:根据传递的参数生成 URL

发布于 2024-10-04 05:08:07 字数 404 浏览 0 评论 0原文

好吧,我已经使用静态 mod_rewrite 规则有一段时间了,就像我以前这样做的那样

RewriteRule ^Animals\.html$  wallpapers.php?f=Animals&of=0&s=Newest

,但现在我想做的是使用关键字创建水蛭页面的 URL...LIKE

preview.php?image=26

Preview.php 是我的水蛭页面 & 。 26 是我在数据库中的 imageID(主键),它对应于 imageName,我希望 mod_rewrite 使用该图像名称创建页面 URL...我一直在谷歌搜索,但可以找到一些可用的教程...任何人都可以帮助我学习如何做吗?

well i have been use static mod_rewrite rules for some time now like i used to do this

RewriteRule ^Animals\.html$  wallpapers.php?f=Animals&of=0&s=Newest

but now what i want to do is create the URL of the leech pages with keywords... LIKE

preview.php?image=26

preview.php is my leech page & 26 is my imageID(primary key) in the database, which corresponds to a imageName, i want the mod_rewrite to create the page URL using that image name... i have been googling about but could find some usable tutorial... can any one help me learn how to do it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我ぃ本無心為│何有愛 2024-10-11 05:08:07

我自己解决了

RewriteRule ^([^/\.]+)/?\.html$ preview.php?image=$1 

solved it myself

RewriteRule ^([^/\.]+)/?\.html$ preview.php?image=$1 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文