anchor() generates wrong links? |
[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.
[eluser]brianw1975[/eluser]
hrm... did you try site_url in place of anchor? Quote:site_url()
[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.
[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 #?
[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
[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 {
[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?
[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
[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.
[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! |
Welcome Guest, Not a member yet? Register Sign In |