Welcome Guest, Not a member yet? Register   Sign In
Code igniter URL confusion
#1

[eluser]proximityfuse[/eluser]
Hello all. I am delighted to have dicovered this beautyfull framework system. I would like to say thank you to the people who have constructed it.

I got some problems however i would appreaciate very much if you could help with them:

1) When I have tried it out i got some problem with my urls.
In a html menu i have links in a view like "controller/page1", "controller/page2" , "controller/page3". It is the same menu for all pages. Before when i used normal php i could click the links to get to the various pages (if the pages were in the same folder) in a normal fashion.

Now however if i am at page1.php at adress index.php/controller/page1 and click at the link of index.php/page2 I do not get to index.php/controller/page1 but to index.php/controller/page2/controller/page1 which is not were I wanted to go. What is the most easy and obvious solution to handle this problem? Should I reroute the addresses or should i include the basepath as a variable in the adress to get an absolute addresspath or do you have any other suggestions? How do you solve this yourself?


2) I have WAMP with Appache 2.2.11. I running CodeIgniter on localhost. The index.php part of the CodeIgniter addresses is irritating to me as to many others so i have tried to remove it i have tried about 10 different .HTACCESS files and tried to change $config['index_page'] = "index.php" to "" and $config['uri_protocol']=AUTO to "QUERY_STRING" but I have not managed to remove index.php. All i get is 500 internal server error do you have any sugestions
what to do?
#2

[eluser]TheIgniter[/eluser]
Hi there,

Welcome to CI, yeah CI ROCKS!!

If i understood your problem, you need just to call the anchor function of CI :
Code:
<?php echo anchor('controller/page1' , 'My link1 ');?>
dont forget to load the url helper :
Code:
$this->load->helper('url');

See more about the url helper :
Code:
http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html
It should solve your problem. Wink




Theme © iAndrew 2016 - Forum software by © MyBB