简体   繁体   English

从php中的url中删除查询字符串

[英]Removing query string from url in php

Lest say i have a link and when some one click on that link it redirect the person to the following page 为免我说我有一个链接,当有人点击该链接时,它会将该人重定向到下一页

http://localhost/install.php?act=go

now i just want to remove everything after ? 现在我只想删除之后的所有内容? so that person doesn't see the actual query string behind it or is there any way to encode the characters and make it look different in browser 这样人就不会看到它背后的实际查询字符串,或者是否有任何方法对字符进行编码并使其在浏览器中看起来不同

You can add a mod_rewrite rule to your htaccess something like 你可以在你的htaccess中添加一个mod_rewrite规则
RewriteRule ^install/([A-Za-z0-9-_]+)$ /install.php?act=$1
that way /install/go takes you to the destinantion 那种方式/ install / go带你到达目的地

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

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