问题
So im trying to build a link using cakephp, here is the code im using:
echo $this->Html->link('FAQs',array('controller' => 'faqs','action' => 'index','full_base' => false));
and the link path im getting back is:
http://mysite.co.uk/websites/123reg/LinuxPackage25/ho/me/tr/mysite.co.uk/public_html/faqs
Im using a linux based hosting.
Has anyone experienced this before? or is able to offer some help.
thanks
回答1:
First of all the problem isn't related to your use of full_base as it defaults to false anyway and should give you:
/faqs
The issue you seem to be having is that http://mysite.co.uk/ is not pointing to the root directory public_html. If you have acccess cPanel i.e. have login credentials for accessing your webhosting and root SSH access, have a look at this blog post and scroll down to Changing Primary domains:
http://blog.servint.net/2012/03/30/the-tech-bench-changing-a-document-root-in-cpanel/
来源:https://stackoverflow.com/questions/22731678/links-not-pointing-to-the-right-place