user_guide页面跳转bug
最近开始看ci框架,已经安装好了,目录为ci发现访问user_guide的时候有bug比如,我正常访问默认的welcome,是这个url:
http://localhost/ci/
这个页面中提示我可以查看user_guide,给出的是链接,可以点,能正常跳转
但是如果我输入完整url:
http://localhost/ci//index.php/welcome
然后再点user_guide的超链接,结果返回404,不能正常跳转。
我的baseurl没有设定,或者设定为http://localhost/ci后,都是这种现象。
这个应该不正常吧?
这里人好少。。。 这里难道没有人吗?为什么回帖的人都没有。。。 http://localhost/ci//index.php/welcome 你这个地址index.php前面怎么有两个斜杠,不该是一个么 dc769319 发表于 2014-8-31 22:18
http://localhost/ci//index.php/welcome 你这个地址index.php前面怎么有两个斜杠,不该是一个么 ...
好吧,这个是我提问的时候写错了,多写了一个斜杠测试发现,如果路径是http://localhost/ci,会自动在尾部添加一个斜杠
如果路径是http://localhost/ci/index.php,能正常跳转到user_guide
如果路径是http://localhost/ci/index.php/,就不能正常跳转到user_guide
如果路径是http://localhost/ci/index.php/welcome或者http://localhost/ci/index.php/welcome/,都不能跳转到user_guide
我想知道这个是什么原因,在哪里设置
因为页面的html代码是这样写的
<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>
链接会跳转到你当前url所在目录下的user_guide目录。而显然,如果路径是
http://localhost/ci/index.php/
http://localhost/ci/index.php/welcome
http://localhost/ci/index.php/welcome/
这些都限定了当前目录非你想要的ci目录,所以就出现了你说的错误。 smallerpig 发表于 2014-9-2 11:46
因为页面的html代码是这样写的
链接会跳转到你当前url所在目录下的user_guide目录。而显然,如果路径是
原来是路径的问题,懂了。
user_guide 使用绝对 URL 就不会有问题啦。这只是一个例子而已,不用太纠结。 :lol:lol:lol:lol:lol:lol:lol:lol:lol:lol:lol:lol:lol:lol:lol:lol:lol:lol:lol
页:
[1]