将这个字符串转入 modwrite

发布于 2024-09-17 00:51:29 字数 145 浏览 1 评论 0原文

pre_config_step_2.php?type=Grocery&count=2

/pre_config_step_2/Grocery/2

我是否需要更改根目录中的 htaccess,如果需要,我该如何将其更改为

pre_config_step_2.php?type=Grocery&count=2

to

/pre_config_step_2/Grocery/2

do i need to change the htaccess in the root directory and if so what do i change it to

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

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

发布评论

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

评论(1

铁憨憨 2024-09-24 00:51:29
<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule   ^pre_config_step_2/(\w+)/(\d+)$ pre_config_step_2.php?type=$1&count=$2
</IfModule>

这将考虑访问 /pre_config_step_2/Grocery/2 就像请求 pre_config_step_2.php?type=Grocery&count=2 一样。

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule   ^pre_config_step_2/(\w+)/(\d+)$ pre_config_step_2.php?type=$1&count=$2
</IfModule>

That would consider accessing /pre_config_step_2/Grocery/2 as if requesting pre_config_step_2.php?type=Grocery&count=2.

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