Home  >  Article  >  Backend Development  >  关于根目录index.php的有关问题

关于根目录index.php的有关问题

WBOY
WBOYOriginal
2016-06-13 10:30:431355browse

关于根目录index.php的问题
我想实现这个功能:
如果输入的网址有二级域名,并且和指定的二级域名匹配,那么,就跳转到指定目录下,例如:
网址:bbs.xxx.com
跳转至:www.xxx.com/bbs/
不匹配的话,就按照原样访问。

可是,我实现出来的效果是这样的:
网址:bbs.xxx.com
跳转至:www.xxx.com/bbs/
跳转至:www.xxx.com/index.html
这就奇怪了,进入www.xxx.com/bbs/里怎么还是根目录的index.php在响应?
我个人认为应该是打开www.xxx.com/bbs/里面的index.html或index.php。

------解决方案--------------------
贴一段代码看一下
------解决方案--------------------
无代码无真相.
另外你的bbs下是不是还有个索引文件index.php...
------解决方案--------------------
检测一下cgi的变量就行。

把phpinfo的资料分析一下,然后在index的最开始检测、跳转。
------解决方案--------------------
是不是你的apache 服务器 路径没有设置好。
------解决方案--------------------
建议修改apache的服务路径设置,
------解决方案--------------------
我猜跟你的地址重写有关系.我对这个不熟悉,还是等熟悉的人来给你解答吧,代码我也就不看了啊...

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