Home  >  Article  >  Backend Development  >  PHP url参数有关问题

PHP url参数有关问题

WBOY
WBOYOriginal
2016-06-13 13:53:50772browse

PHP url参数问题
zhidao.baidu.com/new?fix=&ct=17
这个new是什么,为什么会是这样,怎么得到它,(还是访问的index页吗)详解一下

如何让别人访问本地文件时跳到404你知道的
例如:www.mydomain.com/abc.txt跳到error.html(404你知道的)

谢谢


------解决方案--------------------
new 可以是自定义的任何一个东西,可以是参数也可以是其他的,用$_SERVER['REQUEST_URI']分解字符串就可以得到。如果你自己编写网址解析脚本,并且开启了rewrite功能,就非常容易这是怎么来,怎么用的了
------解决方案--------------------
new?后面直接跟?,一般是使用了框架技术,比如thinkphp,zend framework;或者在apache中配置了url规则,隐去了扩展名。

abc.txt直接跳转到404,是因为该文件在服务器上不存在,之所以跳出“你知道的”,是因为自定义了404.html页面,这个页面一般也在aphche中指定。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn