You don’t need to do anything or download helpers, just keep in mind that the paths will refer to the URL, not the file system or controller.
Assuming your installation is in the root directory of your domain, let your current URL be http://localhost/class/method/var :
<a href="/main/create">Will work from anywhere</a> <a href="create">Will go to http://localhost/class/method/var/create</a> <a href="../create">Will go to http:
Relative paths are not your friend in Codeigniter, you'd better stick with full URLs (usually using helper functions like base_url() and site_url() ), or use a slash (relative to root). People mentioned using the <base> html tag, but I personally do not recommend it. You will have some very stupid URLs if you use ../../relative paths when you go deeper into URL segments. Example:
If you are here: http://localhost/controller/method/var1/var2/var3
The link may look like this: <a href="../../../../controller2/method/othervar"></a>
Probably not what you want, but it is an option that you can choose. I recommend using one of the other two.
source share