ht 访问 mod_rewrite 查询字符串附加标志

发布于 2024-12-28 02:05:50 字数 397 浏览 0 评论 0原文

我在 htaccess 中使用这两行将 /something 定向到 /page.php?page=something。我希望将 /something?key=value 转换为 /page.php?page=something&key=value

这些线路似乎不起作用。

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([a-zA-Z0-9]+)/$ /$1 [R,QSA]
RewriteRule ^([a-zA-Z0-9]+)$ /page.php?page=$1 [L,QSA]

关于如何改进这一点有什么想法吗?

I'm using these two lines in my htaccess to direct /something to /page.php?page=something. I'd like /something?key=value to translate to /page.php?page=something&key=value.

These lines do not seem to be working.

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([a-zA-Z0-9]+)/$ /$1 [R,QSA]
RewriteRule ^([a-zA-Z0-9]+)$ /page.php?page=$1 [L,QSA]

Any ideas on how to improve this?

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

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

发布评论

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

评论(1

摇划花蜜的午后 2025-01-04 02:05:50

我已经解决了这个问题。它实际上不起作用,因为 htaccess 文件中的另一条规则编写不正确。上面的代码工作正常。谢谢。

I've fixed the problem. It actually wasn't working because of another rule in the htaccess file which wasn't written correctly. The code above works fine. Thanks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文