请问给有关问题页面地址后面加斜杠也可以正常浏览,这是咋回事

WBOY
Release: 2016-06-13 12:26:09
Original
1348 people have browsed it

请教给问题页面地址后面加斜杠也可以正常浏览,这是怎么回事?
127.0.0.1/index.php
这是正常的访问情况

后面再加一个斜杠也可以访问,但是整个页面都变形了,这是什么情况?
例如:127.0.0.1/index.php/

没搞明白怎么加斜杠也可以访问,按理是直接报错的啊?


怎么才能判断后面有斜杠?
------解决思路----------------------
只要index.php存在,后面加什么都行啊。
是不是加了“/”样式的路径就变了?

$_SERVER['PATH_INFO']
Copy after login

可以得到额外路径信息
------解决思路----------------------
可以把最后/ 去掉,用rewrite
------解决思路----------------------

引用:
不管是index.php还是login.php都一样啊  后面加“/”都可以访问
但是CSS样式丢失了,而且出现怪怪的布局

怎么才能杜绝呢?

#3
------解决思路----------------------
最后加斜杠出不出错,是服务器软件的事
如果你的样式会丢失,说明css等静态文件的引用地址不规范,仅仅适合当前开发环境
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!