【发布时间】:2022-01-04 00:31:55
【问题描述】:
您好,我想将下面的 URL https://example.com/item?id=223 改写为 https://example.com/google/223。这里会动态生成ID
这个我试过了,但是不行
RewriteRule ^google/$ item?id=$1 [R=301,L]
任何帮助将不胜感激?
【问题讨论】:
-
感谢分享您的努力,请确认您是否在浏览器中点击链接
https://example.com/item?id=223? -
example.com 只是为了理解。实际的 URL 是另一回事。是否需要分享实际的url?
-
是的,我明白了。我的意思是:你的网址中是否有:
item?id=223? -
是的,我想要的是如果有人写example.com/item?id=223 url 应该重写为example.com/google/223 与example.com/item?id=223 相同的内容
-
好的,所以您想将浏览器中的 url 更改为
google/223并在后端由 index.php 文件或其他文件提供服务?
标签: apache .htaccess mod-rewrite friendly-url