简体   繁体   English

网址重写htaccess删除部分网址

[英]Url rewriting htaccess remove part of url

First, I know how to rewrite a URL like example.com/test.php?id=1. 首先,我知道如何重写example.com/test.php?id=1这样的URL。

What I dont know is how to remove the test.php part of the url so that the new url is called: 我不知道如何删除网址的test.php部分,以便调用新网址:

example.com/1/ example.com/1/

I hope someone know how to do that, and yes, I've read a hundreds of SO items about it. 我希望有人知道该怎么做,是的,我已经阅读了数百篇有关它的文章。

Thanks 谢谢

I'm not sure what you mean by removing if you are about to rewrite old one into new one. 我不确定如果要将旧的重写为新的,删除意味着什么。 For example you can do it this way: 例如,您可以这样操作:

RewriteEngine On
RewriteRule tag/s/(.*) test.php?id=$1 [L]

Welcome on Stack Overflow. 欢迎使用Stack Overflow。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM