Problem with URL - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Problem with URL (/showthread.php?tid=23198) |
Problem with URL - El Forum - 10-03-2009 [eluser]The Beginner[/eluser] Hi guy's, I have gotten my main index page finished and it is working great finnally. Now I am building content pages and am having problems getting the content data to load. My Controller code is below. I am using a view file called wpContainer.php to display all pages. I am loading my content data in a model file. When the menu item for streetrods is clicked my URL is changing accordingly but the function that loads the new content data never gets called. URL when the app starts is "http://localhost/index.php" when the menu item is clicked the url changes to: "http://localhost/index.php/wpapp/streetrods/" Code: <?php Problem with URL - El Forum - 10-03-2009 [eluser]InsiteFX[/eluser] Hi, It would help if you show your view code for both functions. Also you should load your model in the Constructor instead of both functions. Enjoy InsiteFX Problem with URL - El Forum - 10-04-2009 [eluser]The Beginner[/eluser] Below is my view code for both functions; Code: <DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" ><html > Problem with URL - El Forum - 10-04-2009 [eluser]The Beginner[/eluser] I added this line in the index: $data['test'] = 'The test is on....'; and this line in streetrods: $data['test'] = 'This is a test to see if this function is being called or not......'; I did this so i could tell if the street rods function was being executed. Unfortunately I do not have debugging installed so I cannot step through the code. I have downloaded a tutorial from the CI Wiki and ran it to see if it worked, and it seams to have a similar problem. The tutorial is Jeffrey Way's day 6 "Login Fool" tutorial. I thought maybe it is something about the way my local server was set up. So I copied a fresh version from the downloaded zip file up to my remote server and I got exactly the same response as on my local server. On the tutorial any time I click the login button or the signup button I get an error Object not found! The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error. Error 404 localhost 10/4/2009 11:44:47 AM Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 When I run the code for my app listed above and I click the menu item for streetrods it simply redisplays the index page. Problem with URL - El Forum - 10-04-2009 [eluser]The Beginner[/eluser] Actually I went back to my remote server and corrected my base_url and now I am getting the exact same situation as with my app. The path for my app is: //$config['base_url'] = "http://localhost/"; $config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http"); $config['base_url'] .= "://".$_SERVER['HTTP_HOST']; $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); The actual path to my localhost is: "C:\xamp\htdocs\" In my local index.php file this is: $application_folder = "wpapp"; Any suggestions would be greatly appreciated. Problem with URL - El Forum - 10-04-2009 [eluser]The Beginner[/eluser] Hey guy's, I solved the problem. Ok, so I am a newbie and most of you may have caught this long before. But, the fix was "$config['uri_protocol'] = "AUTO"; I had this set to : "$config['uri_protocol'] = "QUERY_STRING";" using auto all my apps work fine. Thanks, Del |