Welcome Guest, Not a member yet? Register   Sign In
starting CI3
#3

(01-09-2016, 02:18 PM)PaulD Wrote: Try defining your urls like this:

PHP Code:
<a href="<?php echo site_url('controller/method/whatever_else'); ?>">My LInk</a

A link like this
Code:
<a href="mylink.html">My link</a>

is relative to the root of the page it is on, and you can use things like ../ to move around.

A link like this
Code:
<a href="/mylink.html">My link</a>
is relative to the site root.

Documentation
http://www.codeigniter.com/userguide3/he...l#site_url

I hope that helps,

Best wishes,

Paul.

PS One of the massive benefits is that when you move your site from production to live, or from one domain to another, or from a root to a sub folder etc. all you have to do is edit one entry in the config file.

Thanks, it sure helps and works fine.
Reply


Messages In This Thread
starting CI3 - by eli - 01-09-2016, 10:56 AM
RE: starting CI3 - by PaulD - 01-09-2016, 02:18 PM
RE: starting CI3 - by eli - 01-10-2016, 12:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB