通过 mod 重写从 url 中删除查询字符串
我对 mod 重写非常陌生,因此我们将不胜感激。
假设我有一个名为“www.sitename.com/index.php?p=contact”的网站 我需要删除“index.php?p=” 这样它看起来像“www.sitename/contact” 每次出现时,这意味着我应该能够截断“index.php?p=”,或者我应该能够用一些单词替换它。
I am very new to mod rewrite so any help would be apprecited.
let say i have a site named "www.sitename.com/index.php?p=contact"
and i need to remove "index.php?p="
so that it will look like "www.sitename/contact"
at its every occurence that means either i should be able to truncate "index.php?p=" or i should be able to replace it with some word.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
@zerkms
你的答案不起作用,它不完整
应该有
这些行匹配没有扩展名的URI,所以.php和.html文件
仍然可用
@zerkms
Your answer doesn't work, it's not complete
There should be
These lines matches URI with no extension, so .php and .html files
will still be available