CodeIgniter Forums
base_url - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: base_url (/showthread.php?tid=25534)



base_url - El Forum - 12-15-2009

[eluser]Bob Puzld[/eluser]
Hi, This is probably something easy, but I am somewhat a newbie to Codeigniter. Since I upgraded to the latest version of Codeigniter, my users get this error when logging out of the system:

404 Page Not Found
The page you requested was not found.


With this error my base url ends with /main/something

Here is my code from the logout...

Code:
<a >config->item('base_url')?&gt;login/logout">Logout</a>

Also, my config.php file uses the following code to name the base url...

Code:
$config['base_url']    = "http://www.mywebsite.com/";

Maybe I am looking in the wrong place, but any help would be appreciated.


-Bob


base_url - El Forum - 12-15-2009

[eluser]cahva[/eluser]
Can you give whole html output of the generated link?

BTW, you should use url-helper as that helps a lot Smile

The same with helper:
Code:
&lt;?php echo anchor('login/logout','Logout') ?&gt;

// Will create for example --&gt;
<a href="http://www.mywebsite.com/index.php/login/logout">Logout</a>

If you have .htaccess and you have removed the index.php from config, that will ofcourse be removed from url.


base_url - El Forum - 12-16-2009

[eluser]Bob Puzld[/eluser]
Here is the remaining code...

Code:
&lt;? if($this->session->userdata('ROLE') == 3): ?&gt;
<a >config->item('base_url')?&gt;districts/">Manage Communities</a><br />
<a >config->item('base_url')?&gt;users/">Manage Users</a><br />
<a >config->item('base_url')?&gt;collections/">Manage Collections</a><br />
<a >config->item('base_url')?&gt;organizations/">Manage Organizations</a><br />
<a >config->item('base_url')?&gt;reports/labels">Labels Report</a><br />
&lt;? endif; ?&gt;
<a >config->item('base_url')?&gt;login/logout">Logout</a>