Codeigniter 3 – 当我点击链接时,它使用完整路径

huangapple go评论70阅读模式
英文:

Codeigniter 3 - when I click a link, it uses the full path

问题

I have a view file with the following link (actually, I have a lot but this is just one example):

echo anchor('Faq_public', 'Faq', array('class' => $faq_class));

When I hover over the link, I see what I expect, namely (bottom left hand corner of the browser gives me this):

www.example.com/Faq_public

But when I click it, it uses the full path, and some more, is displayed in the url box for some reason as follows

https://www.example.com/var/www/example.com/public_html/example.com/File_public

I don't have any idea how to correct this. Any advise on how to debug appreciated.

英文:

I have a view file with the following link (actually, I have a lot but this is just one example):

 echo anchor('Faq_public', 'Faq', array('class' => $faq_class)); 

When I hover over the link, I see what I expect, namely (bottom left hand corner of the browser gives me this):

 www.example.com/Faq_public

But when I click it, it uses the full path, and some more, is displayed in the url box for some reason as follows

 https://www.example.com/var/www/example.com/public_html/example.com/File_public

I don't have any idea how to correct this. Any advise on how to debug appreciated.

答案1

得分: 1

$config['base_url'] = 'example.com';

替换为

$config['base_url'] = 'https://example.com/';

并检查是否适用于您。

英文:

Replace

$config['base_url'] = 'example.com';

With

$config['base_url'] = 'https://example.com/';

And check if it works for you

答案2

得分: 0

这是一个完全混乱的 .htaccess 问题。

英文:

It was a totally mixed up .htaccess problem

huangapple
  • 本文由 发表于 2020年1月3日 17:37:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/59576135.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定