Welcome Guest, Not a member yet? Register   Sign In
weird issue with a controller
#1

[eluser]jblack199[/eluser]
I've got a site that I built, and i've put it on 2 different domains...

The first domain works fine... The second domain is having issues....

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {

/**
  * Index Page for this controller.
  *
  * Maps to the following URL
  *   http://example.com/index.php/welcome
  * - or -  
  *   http://example.com/index.php/welcome/index
  * - or -
  * Since this controller is set as the default controller in
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  * @see http://ellislab.com/codeigniter/user-guide/general/urls.html
  */

public function __construct()
       {
            parent::__construct();
   if (strlen($this->input->cookie('prospectId') >= 1)) {
    header("Location: http://www.domain.org/congratulations/");
   }
       }
    
public function index()
{
  $data['main_content'] = "home/index";
  $this->load->view('welcome_message', $data);
}

public function newProspect() {
  echo "yo!";
}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.p

This is an example of my controller.... so when I go to:

http://www.domain.org it pulls up the index perfectly...

however when i go to http://www.domain.org/welcome/newProspect it still only pulls up the index() function instead...

but when i go to http://www.domain.org/index.php/welcome/newProspect it works.. even though I have htaccess in place to remove the index.php from the URL.. which looks like:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ index.php/$1 [L]
    
    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ index.php/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

any ideas?


Messages In This Thread
weird issue with a controller - by El Forum - 01-19-2012, 04:11 PM
weird issue with a controller - by El Forum - 01-19-2012, 10:13 PM
weird issue with a controller - by El Forum - 01-19-2012, 10:27 PM
weird issue with a controller - by El Forum - 01-20-2012, 10:12 AM
weird issue with a controller - by El Forum - 01-20-2012, 12:52 PM
weird issue with a controller - by El Forum - 01-20-2012, 01:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB