Htaccess 删除部分 URL
我有这个网址: http://www.website.nl/pagina/ 4/wie-ben-ik.html
“pagina”是一个真正的php文档。 “4”是网页的id,我用这个id从数据库中获取结果。
我可以将此网址更改为 http://www.website.nl/wie-ben-ik 使用 htaccess?
谢谢你!
I have this URL: http://www.website.nl/pagina/4/wie-ben-ik.html
"pagina" is a real php document.
"4" is the id of the webpage, with the id I get the results from the database.
Can I change this URL to http://www.website.nl/wie-ben-ik with htaccess?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您希望从数据库中查询,则必须以某种方式传递 id。
使用查询字符串(名称-值对)或将其放在 URI 中,就像上面所做的那样。
如果您不想在 URI 中包含
pagina
,您可以使用如下所示的 URI:http://www.website.nl/wie-ben-ik/<您要发送的号码>
You have to pass the id some way or the other if you want it to query from the database.
Either use a query string (name-value pair) or have it in the URI like your are doing above.
If you do not want
pagina
in your URI you can have your URI's like this:http://www.website.nl/wie-ben-ik/<the number you want to send>
尝试将以下内容添加到站点根目录中的
.htaccess
文件中。Try adding the following to the
.htaccess
file in the root directory of your site.