[英]How do you change an URL from something.php?var=val to something more readable/friendly?
[英]PHP URL /?val=something
我今天在WolframAlpha.com上乱七八糟,注意到您从wolframalpha.com/index.html页面开始,然后当您按enter
您将重定向到wolframalpha.com/input/?i=YourSearch
我知道如何进行设置, <form action="newpage.php" method="GET" />
但是对于我正在处理的项目,如果可以重定向到example.com/?val=something
而不是example.com/newpage.php?val=something
是否可以重定向到文件,但是页面名称像WA一样隐藏? 这将是.htacess的工作吗?
编辑:我需要直接从index.php到pages / file.php,而不会在浏览器的URL中显示“ file.php”。 因此,如果我要说:
<form action="pages/file.php" method="GET">
<input type="text" name="foo" />
</form>
然后,如果将我定向到example.com/?foo=blah而不是example.com/pages/file.php?foo=blah
如果在访问www.example.com/
加载了index.php
脚本,则在此页面上具有<form action="">
将执行此操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.