anchor() generates wrong links? - 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: anchor() generates wrong links? (/showthread.php?tid=15429) |
anchor() generates wrong links? - El Forum - 02-19-2009 [eluser]mindesign[/eluser] I'm not using a mod rewrite right now. probably will in the future but what i've tried so far on that hasn't worked all that well. That's just a temporary base url for when i'm working locally. I will change it to my actual domain once I send it to the production server. anchor() generates wrong links? - El Forum - 02-19-2009 [eluser]brianw1975[/eluser] hrm... did you try site_url in place of anchor? Quote:site_url() anchor() generates wrong links? - El Forum - 02-19-2009 [eluser]mindesign[/eluser] Just tried that now. it suffers from the exact same problem. for some reason the index.php in my config file is not being read or something. anchor() generates wrong links? - El Forum - 02-19-2009 [eluser]brianw1975[/eluser] ok.. last thing i can think of.... do you have a .htaccess file in the same location as index.php? if so, are all of the lines commented out with a #? anchor() generates wrong links? - El Forum - 02-20-2009 [eluser]mindesign[/eluser] my .htaccess looks like so Cause I need to be able to upload larger files Code: php_value upload_max_filesize 10M That is all that's in there anchor() generates wrong links? - El Forum - 02-20-2009 [eluser]TheFuzzy0ne[/eluser] If the config file wasn't being loaded, CodeIgniter would let you know. I think that the only possible cause for your problem now is that you're setting $config['index_page'], but you are setting it again somewhere else in the config file or script. I would highly recommend you run a search for the term "$config['index_page']", and see what comes up in the files you've created/edited. EDIT: Also, please try this controller, and let us know what the output is: test_controller.php Code: class Test_controller extends Controller { anchor() generates wrong links? - El Forum - 02-20-2009 [eluser]TheFuzzy0ne[/eluser] Hang on, hang on... I think I know what you're problem might be. Are you actually echoing site_url()? If you are, please could we see the view that's not working? anchor() generates wrong links? - El Forum - 02-20-2009 [eluser]mindesign[/eluser] I'm not echoing the site_url(), just wanted to use it in <a> but then foudn that the anchor() function should be doing exactly what i wanted to do....but it's always missing the needed index.php from the url if I put anchor("news/allNews","all news") it does domain.com/news/allNews instead of domain.com/index.php/news/allNews And all my views work like expected. If i use base_url()."index.php/news/allNews" it works perfectly. :-S anchor() generates wrong links? - El Forum - 02-20-2009 [eluser]TheFuzzy0ne[/eluser] If you're using it in your view, you will need to echo it. Code: <a href="<?php echo site_url('news/allNews'); ?>">All News</a> It might help both of us if you post your view file. anchor() generates wrong links? - El Forum - 02-20-2009 [eluser]mindesign[/eluser] My view is this. I am using a template library to include it in a template Code: <ul id="newsPosts"> I'm still using the anchor here but I'll make it whatever it needs to be for this to work. thanks for the help so far! |