[SOLVED]Segments without index.php |
[eluser]Jaketoolson[/eluser]
It seems as though uri segments without index.php doesn't work correctly, unless I'm doing something wrong. I load my models based on the uri segment and have removed index.php from the uri. It only works with index.php otherwise it errors out. Any suggestions? site.com/index.php/view/html/model_name_here Here is the code from my controller __construct: Code: $this->options['uri'] = $this->input->xss_clean($this->uri->uri_to_assoc(4));
[eluser]Davide Bellini[/eluser]
Have you create .htaccess file?? http://codeigniter.com/wiki/mod_rewrite/
[eluser]Jaketoolson[/eluser]
I'm sorry, I don't get any errors -- it just doesn't load the model_name I need. When I echo out $uri->total_segments() it returns 0, but as soon as I add index.php in the URL, it returns 3. I'm just trying to use segments without the need of index.php in the url. I just want to retrieve wants in uri->segment(3) without the need of index.php in the url!!
[eluser]CoolGoose[/eluser]
Did you remove index.php from the config ? (after you added the htaccess rewrite).
[eluser]Jaketoolson[/eluser]
Yes, in my config I have: Code: $config['index_page'] = ""; Heres my htaccess file: Code: <IfModule mod_rewrite.c>
[eluser]Jaketoolson[/eluser]
has anyone else been able to use segments without index.php in the url?
[eluser]Dennis Rasmussen[/eluser]
[quote author="Jaketoolson" date="1289990774"]has anyone else been able to use segments without index.php in the url?[/quote] We all do
[eluser]Jaketoolson[/eluser]
Well then now I'm really confused why it isn't working for me. I do use PATH_INFO for my uri_protocol: Code: $config['uri_protocol'] = "PATH_INFO"; UPDATE: I changed this to 'AUTO' and it's working! The original reason I set this to PATH_INFO was because I still needed to pass a lot of $_GET variables through the controllers/models (while maintaining some sort of clean URLS). i.e. domain.com/site/html/forward/?hub=32&day=30&time=23 etc. |
Welcome Guest, Not a member yet? Register Sign In |